bgfx/3rdparty/glsl-optimizer/tests/vertex/unity-Surface_Slices3-in.txt

87 lines
2.2 KiB
Text
Raw Normal View History

2012-04-03 23:30:07 -04:00
struct v2f_vertex_lit {
vec2 uv;
vec4 diff;
vec4 spec;
};
struct v2f_img {
vec4 pos;
vec2 uv;
};
struct appdata_img {
vec4 vertex;
vec2 texcoord;
};
struct SurfaceOutput {
vec3 Albedo;
vec3 Normal;
vec3 Emission;
float Specular;
float Gloss;
float Alpha;
};
struct Input {
vec2 uv_MainTex;
vec3 worldPos;
};
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;
};
uniform vec4 _LightShadowData;
uniform mat4 _Object2World;
uniform mat4 _World2Shadow;
uniform mat4 _World2Shadow1;
uniform mat4 _World2Shadow2;
uniform mat4 _World2Shadow3;
v2f_surf vert_surf( in appdata_full v );
v2f_surf vert_surf( in appdata_full v ) {
v2f_surf o;
float z;
vec4 wpos;
o.worldPos = ( _Object2World * v.vertex ).xyz ;
o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
z = ( -( gl_ModelViewMatrix * v.vertex ).z );
o._ShadowZFade.x = z;
o._ShadowZFade.y = ((z * _LightShadowData.z ) + _LightShadowData.w );
wpos = ( _Object2World * v.vertex );
o._ShadowCoord0 = ( _World2Shadow * wpos ).xyz ;
o._ShadowCoord1 = ( _World2Shadow1 * wpos ).xyz ;
o._ShadowCoord2 = ( _World2Shadow2 * wpos ).xyz ;
o._ShadowCoord3 = ( _World2Shadow3 * wpos ).xyz ;
return o;
}
attribute vec4 TANGENT;
void main() {
v2f_surf xl_retval;
appdata_full xlt_v;
xlt_v.vertex = vec4( gl_Vertex);
xlt_v.tangent = vec4( TANGENT);
xlt_v.normal = vec3( gl_Normal);
xlt_v.texcoord = vec4( gl_MultiTexCoord0);
xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
xlt_v.color = vec4( gl_Color);
xl_retval = vert_surf( xlt_v);
gl_Position = vec4( xl_retval.pos);
gl_TexCoord[0] = vec4( xl_retval._ShadowCoord0, 0.0);
gl_TexCoord[1] = vec4( xl_retval._ShadowCoord1, 0.0);
gl_TexCoord[2] = vec4( xl_retval._ShadowCoord2, 0.0);
gl_TexCoord[3] = vec4( xl_retval._ShadowCoord3, 0.0);
gl_TexCoord[4] = vec4( xl_retval._ShadowZFade, 0.0, 0.0);
gl_TexCoord[5] = vec4( xl_retval.worldPos, 0.0);
}