mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
132 lines
2.8 KiB
Text
132 lines
2.8 KiB
Text
struct v2f_surf {
|
|
vec4 pos;
|
|
float fog;
|
|
vec2 hip_pack0;
|
|
vec4 hip_screen;
|
|
};
|
|
struct appdata_full {
|
|
vec4 vertex;
|
|
vec4 tangent;
|
|
vec3 normal;
|
|
vec4 texcoord;
|
|
vec4 texcoord1;
|
|
vec4 color;
|
|
};
|
|
varying vec4 xlv_FOG;
|
|
attribute vec4 TANGENT;
|
|
uniform vec4 _ProjectionParams;
|
|
uniform vec4 _MainTex_ST;
|
|
void PositionFog (
|
|
in vec4 v_1,
|
|
out vec4 pos_2,
|
|
out float fog_3
|
|
)
|
|
{
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1);
|
|
pos_2 = tmpvar_4;
|
|
float tmpvar_5;
|
|
tmpvar_5 = pos_2.z;
|
|
fog_3 = tmpvar_5;
|
|
}
|
|
|
|
vec4 ComputeScreenPos (
|
|
in vec4 pos_6
|
|
)
|
|
{
|
|
vec4 o_7;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = (pos_6 * 0.5);
|
|
o_7 = tmpvar_8;
|
|
vec2 tmpvar_9;
|
|
tmpvar_9.x = o_7.x;
|
|
tmpvar_9.y = (o_7.y * _ProjectionParams.x);
|
|
vec2 tmpvar_10;
|
|
tmpvar_10 = (tmpvar_9 + o_7.w);
|
|
o_7.xy = tmpvar_10.xy.xy;
|
|
vec2 tmpvar_11;
|
|
tmpvar_11 = pos_6.zw;
|
|
o_7.zw = tmpvar_11.xxxy.zw;
|
|
return o_7;
|
|
}
|
|
|
|
v2f_surf vert_surf (
|
|
in appdata_full v_12
|
|
)
|
|
{
|
|
v2f_surf o_13;
|
|
PositionFog (v_12.vertex, o_13.pos, o_13.fog);
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
o_13.hip_pack0 = tmpvar_14.xy.xy;
|
|
vec4 tmpvar_15;
|
|
tmpvar_15 = ComputeScreenPos (o_13.pos);
|
|
vec4 tmpvar_16;
|
|
tmpvar_16 = tmpvar_15;
|
|
o_13.hip_screen = tmpvar_16;
|
|
return o_13;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_full xlt_v_17;
|
|
v2f_surf xl_retval_18;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20 = tmpvar_19;
|
|
xlt_v_17.vertex = tmpvar_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21 = TANGENT.xyzw;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22 = tmpvar_21;
|
|
xlt_v_17.tangent = tmpvar_22;
|
|
vec3 tmpvar_23;
|
|
tmpvar_23 = gl_Normal.xyz;
|
|
vec3 tmpvar_24;
|
|
tmpvar_24 = tmpvar_23;
|
|
xlt_v_17.normal = tmpvar_24;
|
|
vec4 tmpvar_25;
|
|
tmpvar_25 = gl_MultiTexCoord0.xyzw;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26 = tmpvar_25;
|
|
xlt_v_17.texcoord = tmpvar_26;
|
|
vec4 tmpvar_27;
|
|
tmpvar_27 = gl_MultiTexCoord1.xyzw;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28 = tmpvar_27;
|
|
xlt_v_17.texcoord1 = tmpvar_28;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = gl_Color.xyzw;
|
|
vec4 tmpvar_30;
|
|
tmpvar_30 = tmpvar_29;
|
|
xlt_v_17.color = tmpvar_30;
|
|
v2f_surf tmpvar_31;
|
|
tmpvar_31 = vert_surf (xlt_v_17);
|
|
v2f_surf tmpvar_32;
|
|
tmpvar_32 = tmpvar_31;
|
|
xl_retval_18 = tmpvar_32;
|
|
vec4 tmpvar_33;
|
|
tmpvar_33 = xl_retval_18.pos.xyzw;
|
|
vec4 tmpvar_34;
|
|
tmpvar_34 = tmpvar_33;
|
|
gl_Position = tmpvar_34;
|
|
vec4 tmpvar_35;
|
|
tmpvar_35.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_35.x = xl_retval_18.fog;
|
|
vec4 tmpvar_36;
|
|
tmpvar_36 = tmpvar_35;
|
|
xlv_FOG = tmpvar_36;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37.zw = vec2(0.0, 0.0);
|
|
tmpvar_37.xy = xl_retval_18.hip_pack0.xy;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = tmpvar_37;
|
|
gl_TexCoord[0] = tmpvar_38;
|
|
vec4 tmpvar_39;
|
|
tmpvar_39 = xl_retval_18.hip_screen.xyzw;
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = tmpvar_39;
|
|
gl_TexCoord[1] = tmpvar_40;
|
|
}
|
|
|