#version 120 #extension GL_ARB_draw_instanced : require #extension GL_EXT_gpu_shader4 : require 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]); } vec2 xll_matrixindex_mf2x2_i (mat2 m, int i) { vec2 v; v.x=m[0][i]; v.y=m[1][i]; return v; } vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; } vec4 xll_matrixindex_mf4x4_i (mat4 m, int i) { vec4 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; v.w=m[3][i]; return v; } #if defined(SHADER_API_GLES) && defined(SHADER_API_DESKTOP) vec2 xll_matrixindexdynamic_mf2x2_i (mat2 m, int i) { mat2 m2 = xll_transpose(m); return i==0?m2[0]:m2[1]; } vec3 xll_matrixindexdynamic_mf3x3_i (mat3 m, int i) { mat3 m2 = xll_transpose(m); return i < 2?(i==0?m2[0]:m2[1]):(m2[2]); } vec4 xll_matrixindexdynamic_mf4x4_i (mat4 m, int i) { mat4 m2 = xll_transpose(m); return i < 2?(i==0?m2[0]:m2[1]):(i==3?m2[3]:m2[2]); } #else vec2 xll_matrixindexdynamic_mf2x2_i (mat2 m, int i) { return xll_matrixindex_mf2x2_i (m, i); } vec3 xll_matrixindexdynamic_mf3x3_i (mat3 m, int i) { return xll_matrixindex_mf3x3_i (m, i); } vec4 xll_matrixindexdynamic_mf4x4_i (mat4 m, int i) { return xll_matrixindex_mf4x4_i (m, i); } #endif #line 16 struct PS_INPUT { vec4 position; vec2 uv; }; #line 9 struct VS_INPUT { vec4 position; vec2 uv; int vertex_id; int instance_id; }; uniform mat4 world; uniform mat4 view; #line 3 uniform mat4 proj; uniform mat4 stupid[10]; uniform sampler2D diffuse_map; #line 7 uniform sampler2DShadow shadow_map; #line 21 #line 41 mat4 xlat_mutablestupid[10]; #line 21 PS_INPUT vs_main( in VS_INPUT xlat_varinput ) { PS_INPUT o; mat3 dummy = xll_transpose_mf3x3(mat3( vec3( 0.0), vec3( 0.0), vec3( 0.0))); #line 26 vec4 wp = (xlat_varinput.position * world); xlat_mutablestupid[2] = view; vec3 xlat_swiztemp0 = vec3(dummy[1].z, dummy[0].x, dummy[0].x); xlat_mutablestupid[2][0][3] = xlat_swiztemp0.x; xlat_mutablestupid[2][1][3] = xlat_swiztemp0.y; xlat_mutablestupid[2][2][3] = xlat_swiztemp0.z; #line 31 dummy[0][2] = 0.0; vec2 xlat_swiztemp1 = vec2( 0.0, 0.0); dummy[0][2] = xlat_swiztemp1.x; dummy[2][0] = xlat_swiztemp1.y; dummy[2][2] = float( xll_matrixindexdynamic_mf3x3_i (dummy, ((xlat_varinput.instance_id * 2) + xlat_varinput.vertex_id))); #line 35 o.position = ((wp * xlat_mutablestupid[2]) * proj); o.uv = xlat_varinput.uv; return o; } varying vec2 xlv_TEXCOORD0; void main() { xlat_mutablestupid = stupid; PS_INPUT xl_retval; VS_INPUT xlt_xlat_varinput; xlt_xlat_varinput.position = vec4(gl_Vertex); xlt_xlat_varinput.uv = vec2(gl_MultiTexCoord0); xlt_xlat_varinput.vertex_id = int(gl_VertexID); xlt_xlat_varinput.instance_id = int(gl_InstanceIDARB); xl_retval = vs_main( xlt_xlat_varinput); gl_Position = vec4(xl_retval.position); xlv_TEXCOORD0 = vec2(xl_retval.uv); } // uniforms: // proj: type 21 arrsize 0 // view: type 21 arrsize 0 // world: type 21 arrsize 0 // stupid: type 21 arrsize 10