mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
98 lines
2.1 KiB
Text
98 lines
2.1 KiB
Text
|
struct appdata_img {
|
||
|
vec4 vertex;
|
||
|
vec2 texcoord;
|
||
|
};
|
||
|
struct v2f {
|
||
|
vec4 pos;
|
||
|
vec2 uv;
|
||
|
vec2 uvg;
|
||
|
vec2 uvs;
|
||
|
};
|
||
|
uniform vec4 _ScratchOffsetScale;
|
||
|
uniform vec4 _GrainOffsetScale;
|
||
|
vec2 MultiplyUV (
|
||
|
in mat4 mat_1,
|
||
|
in vec2 inUV_2
|
||
|
)
|
||
|
{
|
||
|
vec4 temp_3;
|
||
|
vec4 tmpvar_4;
|
||
|
tmpvar_4.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_4.x = inUV_2.x;
|
||
|
tmpvar_4.y = inUV_2.y;
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5 = tmpvar_4;
|
||
|
temp_3 = tmpvar_5;
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = (mat_1 * temp_3);
|
||
|
temp_3 = tmpvar_6;
|
||
|
return temp_3.xy;
|
||
|
}
|
||
|
|
||
|
v2f vert (
|
||
|
in appdata_img v_7
|
||
|
)
|
||
|
{
|
||
|
v2f o_8;
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = (gl_ModelViewProjectionMatrix * v_7.vertex);
|
||
|
o_8.pos = tmpvar_9;
|
||
|
vec2 tmpvar_10;
|
||
|
tmpvar_10 = MultiplyUV (gl_TextureMatrix[0], v_7.texcoord);
|
||
|
vec2 tmpvar_11;
|
||
|
tmpvar_11 = tmpvar_10;
|
||
|
o_8.uv = tmpvar_11;
|
||
|
vec2 tmpvar_12;
|
||
|
tmpvar_12 = ((v_7.texcoord.xy * _GrainOffsetScale.zw) + _GrainOffsetScale.xy);
|
||
|
o_8.uvg = tmpvar_12;
|
||
|
vec2 tmpvar_13;
|
||
|
tmpvar_13 = ((v_7.texcoord.xy * _ScratchOffsetScale.zw) + _ScratchOffsetScale.xy);
|
||
|
o_8.uvs = tmpvar_13;
|
||
|
return o_8;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_img xlt_v_14;
|
||
|
v2f xl_retval_15;
|
||
|
vec4 tmpvar_16;
|
||
|
tmpvar_16 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_17;
|
||
|
tmpvar_17 = tmpvar_16;
|
||
|
xlt_v_14.vertex = tmpvar_17;
|
||
|
vec2 tmpvar_18;
|
||
|
tmpvar_18 = gl_MultiTexCoord0.xy;
|
||
|
vec2 tmpvar_19;
|
||
|
tmpvar_19 = tmpvar_18;
|
||
|
xlt_v_14.texcoord = tmpvar_19;
|
||
|
v2f tmpvar_20;
|
||
|
tmpvar_20 = vert (xlt_v_14);
|
||
|
v2f tmpvar_21;
|
||
|
tmpvar_21 = tmpvar_20;
|
||
|
xl_retval_15 = tmpvar_21;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = xl_retval_15.pos.xyzw;
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = tmpvar_22;
|
||
|
gl_Position = tmpvar_23;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_24.xy = xl_retval_15.uv.xy;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = tmpvar_24;
|
||
|
gl_TexCoord[0] = tmpvar_25;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_26.xy = xl_retval_15.uvg.xy;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = tmpvar_26;
|
||
|
gl_TexCoord[1] = tmpvar_27;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_28.xy = xl_retval_15.uvs.xy;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = tmpvar_28;
|
||
|
gl_TexCoord[2] = tmpvar_29;
|
||
|
}
|
||
|
|