mat3 xll_constructMat3_mf4x4( mat4 m) { return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2])); } #line 14 struct v2f { vec4 pos; vec4 color; }; #line 9 struct appdata { vec4 vertex; vec3 normal; }; #line 1 uniform vec4 unity_LightColor[4]; uniform vec4 unity_LightPosition[4]; uniform vec4 unity_LightAtten[4]; #line 5 uniform mat4 UNITY_MATRIX_MVP; uniform mat4 UNITY_MATRIX_MV; uniform mat4 UNITY_MATRIX_IT_MV; #line 19 #line 19 vec3 ShadeMyVertexLights( in vec4 vertex, in vec3 normal ) { vec3 viewpos = (UNITY_MATRIX_MV * vertex).xyz; vec3 viewN = (xll_constructMat3_mf4x4( UNITY_MATRIX_IT_MV) * normal); #line 23 vec3 lightColor = vec3( 0.0, 0.0, 0.0); int i = 0; for ( ; (i < 2); (i++)) { vec3 toLight = (unity_LightPosition[i].xyz - viewpos.xyz); #line 27 float lengthSq = dot( toLight, toLight); float atten = (1.0 / (1.0 + (lengthSq * unity_LightAtten[i].z))); float diff = max( 0.0, dot( viewN, normalize(toLight))); lightColor += (unity_LightColor[i].xyz * (diff * atten)); } #line 32 return (lightColor * 2.0); } #line 35 v2f xlat_main( in appdata v ) { #line 37 v2f o; o.pos = (UNITY_MATRIX_MVP * v.vertex); o.color = vec4( ShadeMyVertexLights( v.vertex, v.normal), 1.0); return o; } varying vec4 xlv_TEXCOORD0; void main() { v2f xl_retval; appdata xlt_v; xlt_v.vertex = vec4(gl_Vertex); xlt_v.normal = vec3(gl_Normal); xl_retval = xlat_main( xlt_v); gl_Position = vec4(xl_retval.pos); xlv_TEXCOORD0 = vec4(xl_retval.color); } // uniforms: // UNITY_MATRIX_IT_MV: type 21 arrsize 0 // UNITY_MATRIX_MV: type 21 arrsize 0 // UNITY_MATRIX_MVP: type 21 arrsize 0 // unity_LightAtten: type 12 arrsize 4 // unity_LightColor: type 12 arrsize 4 // unity_LightPosition: type 12 arrsize 4