mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
107 lines
2.2 KiB
Text
107 lines
2.2 KiB
Text
|
struct v2f {
|
||
|
vec4 vertex;
|
||
|
vec4 uvgrab;
|
||
|
vec2 uvbump;
|
||
|
vec2 uvmain;
|
||
|
};
|
||
|
struct appdata_t {
|
||
|
vec4 vertex;
|
||
|
vec2 texcoord;
|
||
|
};
|
||
|
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_t v_7
|
||
|
)
|
||
|
{
|
||
|
float scale_8;
|
||
|
v2f o_9;
|
||
|
float tmpvar_10;
|
||
|
tmpvar_10 = 1.0;
|
||
|
scale_8 = tmpvar_10;
|
||
|
vec4 tmpvar_11;
|
||
|
tmpvar_11 = (gl_ModelViewProjectionMatrix * v_7.vertex);
|
||
|
o_9.vertex = tmpvar_11;
|
||
|
vec2 tmpvar_12;
|
||
|
tmpvar_12.x = o_9.vertex.x;
|
||
|
tmpvar_12.y = (o_9.vertex.y * scale_8);
|
||
|
vec2 tmpvar_13;
|
||
|
tmpvar_13 = ((tmpvar_12 + o_9.vertex.w) * 0.5);
|
||
|
o_9.uvgrab.xy = tmpvar_13.xy.xy;
|
||
|
vec2 tmpvar_14;
|
||
|
tmpvar_14 = o_9.vertex.zw;
|
||
|
o_9.uvgrab.zw = tmpvar_14.xxxy.zw;
|
||
|
vec2 tmpvar_15;
|
||
|
tmpvar_15 = MultiplyUV (gl_TextureMatrix[1], v_7.texcoord);
|
||
|
vec2 tmpvar_16;
|
||
|
tmpvar_16 = tmpvar_15;
|
||
|
o_9.uvbump = tmpvar_16;
|
||
|
vec2 tmpvar_17;
|
||
|
tmpvar_17 = MultiplyUV (gl_TextureMatrix[2], v_7.texcoord);
|
||
|
vec2 tmpvar_18;
|
||
|
tmpvar_18 = tmpvar_17;
|
||
|
o_9.uvmain = tmpvar_18;
|
||
|
return o_9;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_t xlt_v_19;
|
||
|
v2f xl_retval_20;
|
||
|
vec4 tmpvar_21;
|
||
|
tmpvar_21 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = tmpvar_21;
|
||
|
xlt_v_19.vertex = tmpvar_22;
|
||
|
vec2 tmpvar_23;
|
||
|
tmpvar_23 = gl_MultiTexCoord0.xy;
|
||
|
vec2 tmpvar_24;
|
||
|
tmpvar_24 = tmpvar_23;
|
||
|
xlt_v_19.texcoord = tmpvar_24;
|
||
|
v2f tmpvar_25;
|
||
|
tmpvar_25 = vert (xlt_v_19);
|
||
|
v2f tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
xl_retval_20 = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = xl_retval_20.vertex.xyzw;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
gl_Position = tmpvar_28;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = xl_retval_20.uvgrab.xyzw;
|
||
|
vec4 tmpvar_30;
|
||
|
tmpvar_30 = tmpvar_29;
|
||
|
gl_TexCoord[0] = tmpvar_30;
|
||
|
vec4 tmpvar_31;
|
||
|
tmpvar_31.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_31.xy = xl_retval_20.uvbump.xy;
|
||
|
vec4 tmpvar_32;
|
||
|
tmpvar_32 = tmpvar_31;
|
||
|
gl_TexCoord[1] = tmpvar_32;
|
||
|
vec4 tmpvar_33;
|
||
|
tmpvar_33.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_33.xy = xl_retval_20.uvmain.xy;
|
||
|
vec4 tmpvar_34;
|
||
|
tmpvar_34 = tmpvar_33;
|
||
|
gl_TexCoord[2] = tmpvar_34;
|
||
|
}
|
||
|
|