mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
135 lines
2.9 KiB
Text
135 lines
2.9 KiB
Text
struct v2f_surf {
|
|
vec4 pos;
|
|
float fog;
|
|
vec4 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;
|
|
uniform vec4 _Detail_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.xy = tmpvar_14.xy.xy;
|
|
vec2 tmpvar_15;
|
|
tmpvar_15 = ((v_12.texcoord1.xy * _Detail_ST.xy) + _Detail_ST.zw);
|
|
o_13.hip_pack0.zw = tmpvar_15.xxxy.zw;
|
|
vec4 tmpvar_16;
|
|
tmpvar_16 = ComputeScreenPos (o_13.pos);
|
|
vec4 tmpvar_17;
|
|
tmpvar_17 = tmpvar_16;
|
|
o_13.hip_screen = tmpvar_17;
|
|
return o_13;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_full xlt_v_18;
|
|
v2f_surf xl_retval_19;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21 = tmpvar_20;
|
|
xlt_v_18.vertex = tmpvar_21;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22 = TANGENT.xyzw;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23 = tmpvar_22;
|
|
xlt_v_18.tangent = tmpvar_23;
|
|
vec3 tmpvar_24;
|
|
tmpvar_24 = gl_Normal.xyz;
|
|
vec3 tmpvar_25;
|
|
tmpvar_25 = tmpvar_24;
|
|
xlt_v_18.normal = tmpvar_25;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26 = gl_MultiTexCoord0.xyzw;
|
|
vec4 tmpvar_27;
|
|
tmpvar_27 = tmpvar_26;
|
|
xlt_v_18.texcoord = tmpvar_27;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28 = gl_MultiTexCoord1.xyzw;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = tmpvar_28;
|
|
xlt_v_18.texcoord1 = tmpvar_29;
|
|
vec4 tmpvar_30;
|
|
tmpvar_30 = gl_Color.xyzw;
|
|
vec4 tmpvar_31;
|
|
tmpvar_31 = tmpvar_30;
|
|
xlt_v_18.color = tmpvar_31;
|
|
v2f_surf tmpvar_32;
|
|
tmpvar_32 = vert_surf (xlt_v_18);
|
|
v2f_surf tmpvar_33;
|
|
tmpvar_33 = tmpvar_32;
|
|
xl_retval_19 = tmpvar_33;
|
|
vec4 tmpvar_34;
|
|
tmpvar_34 = xl_retval_19.pos.xyzw;
|
|
vec4 tmpvar_35;
|
|
tmpvar_35 = tmpvar_34;
|
|
gl_Position = tmpvar_35;
|
|
vec4 tmpvar_36;
|
|
tmpvar_36.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_36.x = xl_retval_19.fog;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37 = tmpvar_36;
|
|
xlv_FOG = tmpvar_37;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = xl_retval_19.hip_pack0.xyzw;
|
|
vec4 tmpvar_39;
|
|
tmpvar_39 = tmpvar_38;
|
|
gl_TexCoord[0] = tmpvar_39;
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = xl_retval_19.hip_screen.xyzw;
|
|
vec4 tmpvar_41;
|
|
tmpvar_41 = tmpvar_40;
|
|
gl_TexCoord[1] = tmpvar_41;
|
|
}
|
|
|