mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
176 lines
4.2 KiB
Text
176 lines
4.2 KiB
Text
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
float fog;
|
||
|
vec4 hip_pack0;
|
||
|
vec4 hip_pack1;
|
||
|
vec2 hip_pack2;
|
||
|
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 _Splat3_ST;
|
||
|
uniform vec4 _Splat2_ST;
|
||
|
uniform vec4 _Splat1_ST;
|
||
|
uniform vec4 _Splat0_ST;
|
||
|
uniform vec4 _ProjectionParams;
|
||
|
uniform vec4 _Control_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 * _Control_ST.xy) + _Control_ST.zw);
|
||
|
o_13.hip_pack0.xy = tmpvar_14.xy.xy;
|
||
|
vec2 tmpvar_15;
|
||
|
tmpvar_15 = ((v_12.texcoord.xy * _Splat0_ST.xy) + _Splat0_ST.zw);
|
||
|
o_13.hip_pack0.zw = tmpvar_15.xxxy.zw;
|
||
|
vec2 tmpvar_16;
|
||
|
tmpvar_16 = ((v_12.texcoord.xy * _Splat1_ST.xy) + _Splat1_ST.zw);
|
||
|
o_13.hip_pack1.xy = tmpvar_16.xy.xy;
|
||
|
vec2 tmpvar_17;
|
||
|
tmpvar_17 = ((v_12.texcoord.xy * _Splat2_ST.xy) + _Splat2_ST.zw);
|
||
|
o_13.hip_pack1.zw = tmpvar_17.xxxy.zw;
|
||
|
vec2 tmpvar_18;
|
||
|
tmpvar_18 = ((v_12.texcoord.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
|
||
|
o_13.hip_pack2 = tmpvar_18.xy.xy;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19 = ComputeScreenPos (o_13.pos);
|
||
|
vec4 tmpvar_20;
|
||
|
tmpvar_20 = tmpvar_19;
|
||
|
o_13.hip_screen = tmpvar_20;
|
||
|
vec2 tmpvar_21;
|
||
|
tmpvar_21 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
|
||
|
o_13.hip_lmapFade.xy = tmpvar_21.xy.xy;
|
||
|
float tmpvar_22;
|
||
|
tmpvar_22 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w);
|
||
|
o_13.hip_lmapFade.z = vec3(tmpvar_22).z;
|
||
|
return o_13;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_full xlt_v_23;
|
||
|
v2f_surf xl_retval_24;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
xlt_v_23.vertex = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = TANGENT.xyzw;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
xlt_v_23.tangent = tmpvar_28;
|
||
|
vec3 tmpvar_29;
|
||
|
tmpvar_29 = gl_Normal.xyz;
|
||
|
vec3 tmpvar_30;
|
||
|
tmpvar_30 = tmpvar_29;
|
||
|
xlt_v_23.normal = tmpvar_30;
|
||
|
vec4 tmpvar_31;
|
||
|
tmpvar_31 = gl_MultiTexCoord0.xyzw;
|
||
|
vec4 tmpvar_32;
|
||
|
tmpvar_32 = tmpvar_31;
|
||
|
xlt_v_23.texcoord = tmpvar_32;
|
||
|
vec4 tmpvar_33;
|
||
|
tmpvar_33 = gl_MultiTexCoord1.xyzw;
|
||
|
vec4 tmpvar_34;
|
||
|
tmpvar_34 = tmpvar_33;
|
||
|
xlt_v_23.texcoord1 = tmpvar_34;
|
||
|
vec4 tmpvar_35;
|
||
|
tmpvar_35 = gl_Color.xyzw;
|
||
|
vec4 tmpvar_36;
|
||
|
tmpvar_36 = tmpvar_35;
|
||
|
xlt_v_23.color = tmpvar_36;
|
||
|
v2f_surf tmpvar_37;
|
||
|
tmpvar_37 = vert_surf (xlt_v_23);
|
||
|
v2f_surf tmpvar_38;
|
||
|
tmpvar_38 = tmpvar_37;
|
||
|
xl_retval_24 = tmpvar_38;
|
||
|
vec4 tmpvar_39;
|
||
|
tmpvar_39 = xl_retval_24.pos.xyzw;
|
||
|
vec4 tmpvar_40;
|
||
|
tmpvar_40 = tmpvar_39;
|
||
|
gl_Position = tmpvar_40;
|
||
|
vec4 tmpvar_41;
|
||
|
tmpvar_41.yzw = vec3(0.0, 0.0, 0.0);
|
||
|
tmpvar_41.x = xl_retval_24.fog;
|
||
|
vec4 tmpvar_42;
|
||
|
tmpvar_42 = tmpvar_41;
|
||
|
xlv_FOG = tmpvar_42;
|
||
|
vec4 tmpvar_43;
|
||
|
tmpvar_43 = xl_retval_24.hip_pack0.xyzw;
|
||
|
vec4 tmpvar_44;
|
||
|
tmpvar_44 = tmpvar_43;
|
||
|
gl_TexCoord[0] = tmpvar_44;
|
||
|
vec4 tmpvar_45;
|
||
|
tmpvar_45 = xl_retval_24.hip_pack1.xyzw;
|
||
|
vec4 tmpvar_46;
|
||
|
tmpvar_46 = tmpvar_45;
|
||
|
gl_TexCoord[1] = tmpvar_46;
|
||
|
vec4 tmpvar_47;
|
||
|
tmpvar_47.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_47.xy = xl_retval_24.hip_pack2.xy;
|
||
|
vec4 tmpvar_48;
|
||
|
tmpvar_48 = tmpvar_47;
|
||
|
gl_TexCoord[2] = tmpvar_48;
|
||
|
vec4 tmpvar_49;
|
||
|
tmpvar_49 = xl_retval_24.hip_screen.xyzw;
|
||
|
vec4 tmpvar_50;
|
||
|
tmpvar_50 = tmpvar_49;
|
||
|
gl_TexCoord[3] = tmpvar_50;
|
||
|
vec4 tmpvar_51;
|
||
|
tmpvar_51.w = 0.0;
|
||
|
tmpvar_51.xyz = xl_retval_24.hip_lmapFade.xyz;
|
||
|
vec4 tmpvar_52;
|
||
|
tmpvar_52 = tmpvar_51;
|
||
|
gl_TexCoord[4] = tmpvar_52;
|
||
|
}
|
||
|
|