mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
130 lines
2.8 KiB
Text
130 lines
2.8 KiB
Text
struct appdata_img {
|
|
vec4 vertex;
|
|
vec2 texcoord;
|
|
};
|
|
struct v2f {
|
|
vec4 pos;
|
|
vec4 uv[4];
|
|
};
|
|
uniform vec4 _MainTex_TexelSize;
|
|
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
|
|
)
|
|
{
|
|
float offY_8;
|
|
float offX_9;
|
|
vec4 uv_10;
|
|
v2f o_11;
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = (gl_ModelViewProjectionMatrix * v_7.vertex);
|
|
o_11.pos = tmpvar_12;
|
|
vec2 tmpvar_13;
|
|
tmpvar_13 = MultiplyUV (gl_TextureMatrix[0], v_7.texcoord);
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = tmpvar_13;
|
|
uv_10.xy = tmpvar_14.xy.xy;
|
|
vec2 tmpvar_15;
|
|
tmpvar_15 = vec2(0.0, 0.0);
|
|
uv_10.zw = tmpvar_15.xxxy.zw;
|
|
float tmpvar_16;
|
|
tmpvar_16 = _MainTex_TexelSize.x;
|
|
offX_9 = tmpvar_16;
|
|
float tmpvar_17;
|
|
tmpvar_17 = _MainTex_TexelSize.y;
|
|
offY_8 = tmpvar_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18.zw = vec2(0.0, 1.0);
|
|
tmpvar_18.x = -(offX_9);
|
|
tmpvar_18.y = -(offY_8);
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = (uv_10 + tmpvar_18);
|
|
o_11.uv[0] = tmpvar_19;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.zw = vec2(0.0, 1.0);
|
|
tmpvar_20.x = offX_9;
|
|
tmpvar_20.y = -(offY_8);
|
|
vec4 tmpvar_21;
|
|
tmpvar_21 = (uv_10 + tmpvar_20);
|
|
o_11.uv[1] = tmpvar_21;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.zw = vec2(0.0, 1.0);
|
|
tmpvar_22.x = offX_9;
|
|
tmpvar_22.y = offY_8;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23 = (uv_10 + tmpvar_22);
|
|
o_11.uv[2] = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24.zw = vec2(0.0, 1.0);
|
|
tmpvar_24.x = -(offX_9);
|
|
tmpvar_24.y = offY_8;
|
|
vec4 tmpvar_25;
|
|
tmpvar_25 = (uv_10 + tmpvar_24);
|
|
o_11.uv[3] = tmpvar_25;
|
|
return o_11;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_img xlt_v_26;
|
|
v2f xl_retval_27;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = tmpvar_28;
|
|
xlt_v_26.vertex = tmpvar_29;
|
|
vec2 tmpvar_30;
|
|
tmpvar_30 = gl_MultiTexCoord0.xy;
|
|
vec2 tmpvar_31;
|
|
tmpvar_31 = tmpvar_30;
|
|
xlt_v_26.texcoord = tmpvar_31;
|
|
v2f tmpvar_32;
|
|
tmpvar_32 = vert (xlt_v_26);
|
|
v2f tmpvar_33;
|
|
tmpvar_33 = tmpvar_32;
|
|
xl_retval_27 = tmpvar_33;
|
|
vec4 tmpvar_34;
|
|
tmpvar_34 = xl_retval_27.pos.xyzw;
|
|
vec4 tmpvar_35;
|
|
tmpvar_35 = tmpvar_34;
|
|
gl_Position = tmpvar_35;
|
|
vec4 tmpvar_36;
|
|
tmpvar_36 = xl_retval_27.uv[0].xyzw;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37 = tmpvar_36;
|
|
gl_TexCoord[0] = tmpvar_37;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = xl_retval_27.uv[1].xyzw;
|
|
vec4 tmpvar_39;
|
|
tmpvar_39 = tmpvar_38;
|
|
gl_TexCoord[1] = tmpvar_39;
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = xl_retval_27.uv[2].xyzw;
|
|
vec4 tmpvar_41;
|
|
tmpvar_41 = tmpvar_40;
|
|
gl_TexCoord[2] = tmpvar_41;
|
|
vec4 tmpvar_42;
|
|
tmpvar_42 = xl_retval_27.uv[3].xyzw;
|
|
vec4 tmpvar_43;
|
|
tmpvar_43 = tmpvar_42;
|
|
gl_TexCoord[3] = tmpvar_43;
|
|
}
|
|
|