mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
163 lines
3.5 KiB
Text
163 lines
3.5 KiB
Text
struct appdata_full {
|
|
vec4 vertex;
|
|
vec4 tangent;
|
|
vec3 normal;
|
|
vec4 texcoord;
|
|
vec4 texcoord1;
|
|
vec4 color;
|
|
};
|
|
struct Input {
|
|
vec3 foo;
|
|
};
|
|
struct v2f_surf {
|
|
vec4 pos;
|
|
float fog;
|
|
vec3 cust_foo;
|
|
vec4 hip_screen;
|
|
vec3 hip_lmapFade;
|
|
};
|
|
uniform vec4 _ProjectionParams;
|
|
uniform vec4 unity_LightmapFade;
|
|
uniform vec4 unity_LightmapST;
|
|
attribute vec4 TANGENT;
|
|
varying vec4 xlv_FOG;
|
|
void vert (
|
|
inout appdata_full v_1,
|
|
out Input o_2
|
|
)
|
|
{
|
|
vec3 tmpvar_3;
|
|
tmpvar_3 = ((v_1.normal * 0.5) + 0.5);
|
|
o_2.foo = tmpvar_3;
|
|
}
|
|
|
|
void PositionFog (
|
|
in vec4 v_4,
|
|
out vec4 pos_5,
|
|
out float fog_6
|
|
)
|
|
{
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = (gl_ModelViewProjectionMatrix * v_4);
|
|
pos_5 = tmpvar_7;
|
|
float tmpvar_8;
|
|
tmpvar_8 = pos_5.z;
|
|
fog_6 = tmpvar_8;
|
|
}
|
|
|
|
vec4 ComputeScreenPos (
|
|
in vec4 pos_9
|
|
)
|
|
{
|
|
vec4 o_10;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = (pos_9 * 0.5);
|
|
o_10 = tmpvar_11;
|
|
vec2 tmpvar_12;
|
|
tmpvar_12.x = o_10.x;
|
|
tmpvar_12.y = (o_10.y * _ProjectionParams.x);
|
|
vec2 tmpvar_13;
|
|
tmpvar_13 = (tmpvar_12 + o_10.w);
|
|
o_10.xy = tmpvar_13.xy.xy;
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = pos_9.zw;
|
|
o_10.zw = tmpvar_14.xxxy.zw;
|
|
return o_10;
|
|
}
|
|
|
|
v2f_surf vert_surf (
|
|
in appdata_full v_15
|
|
)
|
|
{
|
|
v2f_surf o_16;
|
|
Input customInputData_17;
|
|
vert (v_15, customInputData_17);
|
|
vec3 tmpvar_18;
|
|
tmpvar_18 = customInputData_17.foo;
|
|
o_16.cust_foo = tmpvar_18;
|
|
PositionFog (v_15.vertex, o_16.pos, o_16.fog);
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = ComputeScreenPos (o_16.pos);
|
|
vec4 tmpvar_20;
|
|
tmpvar_20 = tmpvar_19;
|
|
o_16.hip_screen = tmpvar_20;
|
|
vec2 tmpvar_21;
|
|
tmpvar_21 = ((v_15.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
|
|
o_16.hip_lmapFade.xy = tmpvar_21.xy.xy;
|
|
float tmpvar_22;
|
|
tmpvar_22 = ((-(
|
|
(gl_ModelViewMatrix * v_15.vertex)
|
|
.z) * unity_LightmapFade.z) + unity_LightmapFade.w);
|
|
o_16.hip_lmapFade.z = vec3(tmpvar_22).z;
|
|
return o_16;
|
|
}
|
|
|
|
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.w = 0.0;
|
|
tmpvar_43.xyz = xl_retval_24.cust_foo.xyz;
|
|
vec4 tmpvar_44;
|
|
tmpvar_44 = tmpvar_43;
|
|
gl_TexCoord[0] = tmpvar_44;
|
|
vec4 tmpvar_45;
|
|
tmpvar_45 = xl_retval_24.hip_screen.xyzw;
|
|
vec4 tmpvar_46;
|
|
tmpvar_46 = tmpvar_45;
|
|
gl_TexCoord[1] = tmpvar_46;
|
|
vec4 tmpvar_47;
|
|
tmpvar_47.w = 0.0;
|
|
tmpvar_47.xyz = xl_retval_24.hip_lmapFade.xyz;
|
|
vec4 tmpvar_48;
|
|
tmpvar_48 = tmpvar_47;
|
|
gl_TexCoord[2] = tmpvar_48;
|
|
}
|
|
|