mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
148 lines
3.3 KiB
Text
148 lines
3.3 KiB
Text
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
float fog;
|
||
|
vec2 hip_pack0;
|
||
|
vec4 hip_screen;
|
||
|
vec3 hip_lmapFade;
|
||
|
};
|
||
|
struct appdata_full {
|
||
|
vec4 vertex;
|
||
|
vec4 tangent;
|
||
|
vec3 normal;
|
||
|
vec4 texcoord;
|
||
|
vec4 texcoord1;
|
||
|
vec4 color;
|
||
|
};
|
||
|
varying vec4 xlv_FOG;
|
||
|
attribute vec4 TANGENT;
|
||
|
uniform vec4 unity_LightmapST;
|
||
|
uniform vec4 unity_LightmapFade;
|
||
|
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;
|
||
|
vec2 tmpvar_17;
|
||
|
tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
|
||
|
o_13.hip_lmapFade.xy = tmpvar_17.xy.xy;
|
||
|
float tmpvar_18;
|
||
|
tmpvar_18 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w);
|
||
|
o_13.hip_lmapFade.z = vec3(tmpvar_18).z;
|
||
|
return o_13;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_full xlt_v_19;
|
||
|
v2f_surf xl_retval_20;
|
||
|
vec4 tmpvar_21;
|
||
|
tmpvar_21 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = tmpvar_21;
|
||
|
xlt_v_19.vertex = tmpvar_22;
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = TANGENT.xyzw;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24 = tmpvar_23;
|
||
|
xlt_v_19.tangent = tmpvar_24;
|
||
|
vec3 tmpvar_25;
|
||
|
tmpvar_25 = gl_Normal.xyz;
|
||
|
vec3 tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
xlt_v_19.normal = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = gl_MultiTexCoord0.xyzw;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
xlt_v_19.texcoord = tmpvar_28;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = gl_MultiTexCoord1.xyzw;
|
||
|
vec4 tmpvar_30;
|
||
|
tmpvar_30 = tmpvar_29;
|
||
|
xlt_v_19.texcoord1 = tmpvar_30;
|
||
|
vec4 tmpvar_31;
|
||
|
tmpvar_31 = gl_Color.xyzw;
|
||
|
vec4 tmpvar_32;
|
||
|
tmpvar_32 = tmpvar_31;
|
||
|
xlt_v_19.color = tmpvar_32;
|
||
|
v2f_surf tmpvar_33;
|
||
|
tmpvar_33 = vert_surf (xlt_v_19);
|
||
|
v2f_surf tmpvar_34;
|
||
|
tmpvar_34 = tmpvar_33;
|
||
|
xl_retval_20 = tmpvar_34;
|
||
|
vec4 tmpvar_35;
|
||
|
tmpvar_35 = xl_retval_20.pos.xyzw;
|
||
|
vec4 tmpvar_36;
|
||
|
tmpvar_36 = tmpvar_35;
|
||
|
gl_Position = tmpvar_36;
|
||
|
vec4 tmpvar_37;
|
||
|
tmpvar_37.yzw = vec3(0.0, 0.0, 0.0);
|
||
|
tmpvar_37.x = xl_retval_20.fog;
|
||
|
vec4 tmpvar_38;
|
||
|
tmpvar_38 = tmpvar_37;
|
||
|
xlv_FOG = tmpvar_38;
|
||
|
vec4 tmpvar_39;
|
||
|
tmpvar_39.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_39.xy = xl_retval_20.hip_pack0.xy;
|
||
|
vec4 tmpvar_40;
|
||
|
tmpvar_40 = tmpvar_39;
|
||
|
gl_TexCoord[0] = tmpvar_40;
|
||
|
vec4 tmpvar_41;
|
||
|
tmpvar_41 = xl_retval_20.hip_screen.xyzw;
|
||
|
vec4 tmpvar_42;
|
||
|
tmpvar_42 = tmpvar_41;
|
||
|
gl_TexCoord[1] = tmpvar_42;
|
||
|
vec4 tmpvar_43;
|
||
|
tmpvar_43.w = 0.0;
|
||
|
tmpvar_43.xyz = xl_retval_20.hip_lmapFade.xyz;
|
||
|
vec4 tmpvar_44;
|
||
|
tmpvar_44 = tmpvar_43;
|
||
|
gl_TexCoord[2] = tmpvar_44;
|
||
|
}
|
||
|
|