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