#ifdef GL_ES precision mediump int; precision highp float; #endif #define USE_OGRE_FROM_FUTURE #include OGRE_UNIFORMS( uniform mat4 worldViewProjMatrix; uniform mat4 worldMat; uniform mat4 witMat; uniform mat4 texWorldViewProjMatrix0; uniform mat4 texWorldViewProjMatrix1; uniform mat4 texWorldViewProjMatrix2; uniform mat4 texWorldViewProjMatrix3; uniform mat4 texMat0; ) MAIN_PARAMETERS IN(vec4 vertex, POSITION) IN(vec4 normal, NORMAL) IN(vec2 uv0, TEXCOORD0) OUT(vec3 oWp, TEXCOORD0) OUT(vec3 oNormal, TEXCOORD1) OUT(vec3 oUv, TEXCOORD2) OUT(vec4 oLightPosition0, TEXCOORD3) OUT(vec4 oLightPosition1, TEXCOORD4) OUT(vec4 oLightPosition2, TEXCOORD5) OUT(vec4 oLightPosition3, TEXCOORD6) MAIN_DECLARATION { // calculate output position vec4 oPos = mul(worldViewProjMatrix, vertex); vec4 wp = mul(worldMat, vertex); oNormal = normalize(mul(witMat, normal).xyz); // pass the main uvs straight through unchanged oUv.xy = mul(texMat0, vec4(uv0.x, uv0.y, 0.0, 1.0)).xy; oUv.z = oPos.z; // Calculate the position of vertex in light space oLightPosition0 = mul(texWorldViewProjMatrix0, wp); oLightPosition1 = mul(texWorldViewProjMatrix1, wp); oLightPosition2 = mul(texWorldViewProjMatrix2, wp); oLightPosition3 = mul(texWorldViewProjMatrix3, wp); oWp = wp.xyz; gl_Position = oPos; }