mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
146 lines
3.5 KiB
Text
146 lines
3.5 KiB
Text
struct v2f_surf {
|
|
vec4 pos;
|
|
vec3 _ShadowCoord0;
|
|
vec3 _ShadowCoord1;
|
|
vec3 _ShadowCoord2;
|
|
vec3 _ShadowCoord3;
|
|
vec2 _ShadowZFade;
|
|
vec3 worldPos;
|
|
};
|
|
struct appdata_full {
|
|
vec4 vertex;
|
|
vec4 tangent;
|
|
vec3 normal;
|
|
vec4 texcoord;
|
|
vec4 texcoord1;
|
|
vec4 color;
|
|
};
|
|
attribute vec4 TANGENT;
|
|
uniform mat4 _World2Shadow3;
|
|
uniform mat4 _World2Shadow2;
|
|
uniform mat4 _World2Shadow1;
|
|
uniform mat4 _World2Shadow;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _LightShadowData;
|
|
v2f_surf vert_surf (
|
|
in appdata_full v_1
|
|
)
|
|
{
|
|
vec4 wpos_2;
|
|
float z_3;
|
|
v2f_surf o_4;
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = (_Object2World * v_1.vertex).xyz;
|
|
o_4.worldPos = tmpvar_5;
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (gl_ModelViewProjectionMatrix * v_1.vertex);
|
|
o_4.pos = tmpvar_6;
|
|
float tmpvar_7;
|
|
tmpvar_7 = -((gl_ModelViewMatrix * v_1.vertex).z);
|
|
z_3 = tmpvar_7;
|
|
float tmpvar_8;
|
|
tmpvar_8 = z_3;
|
|
o_4._ShadowZFade.x = tmpvar_8;
|
|
float tmpvar_9;
|
|
tmpvar_9 = ((z_3 * _LightShadowData.z) + _LightShadowData.w);
|
|
o_4._ShadowZFade.y = vec2(tmpvar_9).y;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = (_Object2World * v_1.vertex);
|
|
wpos_2 = tmpvar_10;
|
|
vec3 tmpvar_11;
|
|
tmpvar_11 = (_World2Shadow * wpos_2).xyz;
|
|
o_4._ShadowCoord0 = tmpvar_11;
|
|
vec3 tmpvar_12;
|
|
tmpvar_12 = (_World2Shadow1 * wpos_2).xyz;
|
|
o_4._ShadowCoord1 = tmpvar_12;
|
|
vec3 tmpvar_13;
|
|
tmpvar_13 = (_World2Shadow2 * wpos_2).xyz;
|
|
o_4._ShadowCoord2 = tmpvar_13;
|
|
vec3 tmpvar_14;
|
|
tmpvar_14 = (_World2Shadow3 * wpos_2).xyz;
|
|
o_4._ShadowCoord3 = tmpvar_14;
|
|
return o_4;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_full xlt_v_15;
|
|
v2f_surf xl_retval_16;
|
|
vec4 tmpvar_17;
|
|
tmpvar_17 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18 = tmpvar_17;
|
|
xlt_v_15.vertex = tmpvar_18;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = TANGENT.xyzw;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20 = tmpvar_19;
|
|
xlt_v_15.tangent = tmpvar_20;
|
|
vec3 tmpvar_21;
|
|
tmpvar_21 = gl_Normal.xyz;
|
|
vec3 tmpvar_22;
|
|
tmpvar_22 = tmpvar_21;
|
|
xlt_v_15.normal = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23 = gl_MultiTexCoord0.xyzw;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24 = tmpvar_23;
|
|
xlt_v_15.texcoord = tmpvar_24;
|
|
vec4 tmpvar_25;
|
|
tmpvar_25 = gl_MultiTexCoord1.xyzw;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26 = tmpvar_25;
|
|
xlt_v_15.texcoord1 = tmpvar_26;
|
|
vec4 tmpvar_27;
|
|
tmpvar_27 = gl_Color.xyzw;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28 = tmpvar_27;
|
|
xlt_v_15.color = tmpvar_28;
|
|
v2f_surf tmpvar_29;
|
|
tmpvar_29 = vert_surf (xlt_v_15);
|
|
v2f_surf tmpvar_30;
|
|
tmpvar_30 = tmpvar_29;
|
|
xl_retval_16 = tmpvar_30;
|
|
vec4 tmpvar_31;
|
|
tmpvar_31 = xl_retval_16.pos.xyzw;
|
|
vec4 tmpvar_32;
|
|
tmpvar_32 = tmpvar_31;
|
|
gl_Position = tmpvar_32;
|
|
vec4 tmpvar_33;
|
|
tmpvar_33.w = 0.0;
|
|
tmpvar_33.xyz = xl_retval_16._ShadowCoord0.xyz;
|
|
vec4 tmpvar_34;
|
|
tmpvar_34 = tmpvar_33;
|
|
gl_TexCoord[0] = tmpvar_34;
|
|
vec4 tmpvar_35;
|
|
tmpvar_35.w = 0.0;
|
|
tmpvar_35.xyz = xl_retval_16._ShadowCoord1.xyz;
|
|
vec4 tmpvar_36;
|
|
tmpvar_36 = tmpvar_35;
|
|
gl_TexCoord[1] = tmpvar_36;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37.w = 0.0;
|
|
tmpvar_37.xyz = xl_retval_16._ShadowCoord2.xyz;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = tmpvar_37;
|
|
gl_TexCoord[2] = tmpvar_38;
|
|
vec4 tmpvar_39;
|
|
tmpvar_39.w = 0.0;
|
|
tmpvar_39.xyz = xl_retval_16._ShadowCoord3.xyz;
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = tmpvar_39;
|
|
gl_TexCoord[3] = tmpvar_40;
|
|
vec4 tmpvar_41;
|
|
tmpvar_41.zw = vec2(0.0, 0.0);
|
|
tmpvar_41.xy = xl_retval_16._ShadowZFade.xy;
|
|
vec4 tmpvar_42;
|
|
tmpvar_42 = tmpvar_41;
|
|
gl_TexCoord[4] = tmpvar_42;
|
|
vec4 tmpvar_43;
|
|
tmpvar_43.w = 0.0;
|
|
tmpvar_43.xyz = xl_retval_16.worldPos.xyz;
|
|
vec4 tmpvar_44;
|
|
tmpvar_44 = tmpvar_43;
|
|
gl_TexCoord[5] = tmpvar_44;
|
|
}
|
|
|