mat2 xll_transpose_mf2x2(mat2 m) { return mat2( m[0][0], m[1][0], m[0][1], m[1][1]); } mat3 xll_transpose_mf3x3(mat3 m) { return mat3( m[0][0], m[1][0], m[2][0], m[0][1], m[1][1], m[2][1], m[0][2], m[1][2], m[2][2]); } mat4 xll_transpose_mf4x4(mat4 m) { return mat4( m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]); } float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(mat3 m) { return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); } mat4 xll_saturate_mf4x4(mat4 m) { return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); } #line 9 #line 17 uniform sampler2D mytex; #line 9 vec4 DirLM( in vec3 scale, in vec3 normal ) { mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.8164966, 0.0, 0.5773503), vec3( -0.4082483, 0.7071068, 0.5773503), vec3( -0.4082483, -0.7071068, 0.5773503))); vec3 normalInDirBasis = xll_saturate_vf3((unity_DirBasis * normal)); #line 13 float f = dot( normalInDirBasis, scale); return vec4( f); } #line 19 vec4 xlat_main( in vec2 uv, in vec3 normal ) { #line 21 vec3 scale = texture2D( mytex, uv).xyz; return DirLM( scale, normal); } varying vec2 xlv_TEXCOORD0; varying vec3 xlv_TEXCOORD1; void main() { vec4 xl_retval; xl_retval = xlat_main( vec2(xlv_TEXCOORD0), vec3(xlv_TEXCOORD1)); gl_FragData[0] = vec4(xl_retval); } // uniforms: // mytex: type 25 arrsize 0