#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 texMat; ) MAIN_PARAMETERS IN(vec4 vertex, POSITION) IN(vec4 normal, NORMAL) IN(vec2 uv0, TEXCOORD0) OUT(vec3 oUv, TEXCOORD0) OUT(vec3 oNormal, TEXCOORD1) OUT(vec3 oWp, TEXCOORD2) OUT(vec4 oLightPosition0, TEXCOORD3) OUT(vec4 oLightPosition1, TEXCOORD4) OUT(vec4 oLightPosition2, TEXCOORD5) 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(texMat, 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); oWp = wp.xyz; gl_Position = oPos; }