mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
130 lines
2.6 KiB
Text
130 lines
2.6 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,
|
|
in vec2 inUV
|
|
)
|
|
{
|
|
vec4 temp;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1.zw = vec2(0.0, 0.0);
|
|
tmpvar_1.x = inUV.x;
|
|
tmpvar_1.y = inUV.y;
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = tmpvar_1;
|
|
temp = tmpvar_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = (mat * temp);
|
|
temp = tmpvar_3;
|
|
return temp.xy;
|
|
}
|
|
|
|
v2f vert (
|
|
in appdata_img v
|
|
)
|
|
{
|
|
float offY;
|
|
float offX;
|
|
vec4 uv;
|
|
v2f o;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = (gl_ModelViewProjectionMatrix * v.vertex);
|
|
o.pos = tmpvar_1;
|
|
vec2 tmpvar_2;
|
|
tmpvar_2 = MultiplyUV (gl_TextureMatrix[0], v.texcoord);
|
|
vec2 tmpvar_3;
|
|
tmpvar_3 = tmpvar_2;
|
|
uv.xy = tmpvar_3.xy.xy;
|
|
vec2 tmpvar_4;
|
|
tmpvar_4 = vec2(0.0, 0.0);
|
|
uv.zw = tmpvar_4.xxxy.zw;
|
|
float tmpvar_5;
|
|
tmpvar_5 = _MainTex_TexelSize.x;
|
|
offX = tmpvar_5;
|
|
float tmpvar_6;
|
|
tmpvar_6 = _MainTex_TexelSize.y;
|
|
offY = tmpvar_6;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.zw = vec2(0.0, 1.0);
|
|
tmpvar_7.x = -(offX);
|
|
tmpvar_7.y = -(offY);
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = (uv + tmpvar_7);
|
|
o.uv[0] = tmpvar_8;
|
|
vec4 tmpvar_9;
|
|
tmpvar_9.zw = vec2(0.0, 1.0);
|
|
tmpvar_9.x = offX;
|
|
tmpvar_9.y = -(offY);
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = (uv + tmpvar_9);
|
|
o.uv[1] = tmpvar_10;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11.zw = vec2(0.0, 1.0);
|
|
tmpvar_11.x = offX;
|
|
tmpvar_11.y = offY;
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = (uv + tmpvar_11);
|
|
o.uv[2] = tmpvar_12;
|
|
vec4 tmpvar_13;
|
|
tmpvar_13.zw = vec2(0.0, 1.0);
|
|
tmpvar_13.x = -(offX);
|
|
tmpvar_13.y = offY;
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = (uv + tmpvar_13);
|
|
o.uv[3] = tmpvar_14;
|
|
return o;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_img xlt_v;
|
|
v2f xl_retval;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = tmpvar_1;
|
|
xlt_v.vertex = tmpvar_2;
|
|
vec2 tmpvar_3;
|
|
tmpvar_3 = gl_MultiTexCoord0.xy;
|
|
vec2 tmpvar_4;
|
|
tmpvar_4 = tmpvar_3;
|
|
xlt_v.texcoord = tmpvar_4;
|
|
v2f tmpvar_5;
|
|
tmpvar_5 = vert (xlt_v);
|
|
v2f tmpvar_6;
|
|
tmpvar_6 = tmpvar_5;
|
|
xl_retval = tmpvar_6;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = xl_retval.pos.xyzw;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = tmpvar_7;
|
|
gl_Position = tmpvar_8;
|
|
vec4 tmpvar_9;
|
|
tmpvar_9 = xl_retval.uv[0].xyzw;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = tmpvar_9;
|
|
gl_TexCoord[0] = tmpvar_10;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = xl_retval.uv[1].xyzw;
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = tmpvar_11;
|
|
gl_TexCoord[1] = tmpvar_12;
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = xl_retval.uv[2].xyzw;
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = tmpvar_13;
|
|
gl_TexCoord[2] = tmpvar_14;
|
|
vec4 tmpvar_15;
|
|
tmpvar_15 = xl_retval.uv[3].xyzw;
|
|
vec4 tmpvar_16;
|
|
tmpvar_16 = tmpvar_15;
|
|
gl_TexCoord[3] = tmpvar_16;
|
|
}
|
|
|