#ifdef GL_ES precision mediump int; precision highp float; #endif #define USE_OGRE_FROM_FUTURE #include OGRE_UNIFORMS( uniform mat4 worldViewProj; uniform mat4 worldMat; uniform vec4 texelOffsets; uniform mat4 texMat; ) MAIN_PARAMETERS IN(vec4 vertex, POSITION) IN(vec2 uv0, TEXCOORD0) OUT(vec4 oUv0, TEXCOORD0) OUT(vec4 oWp, TEXCOORD1) MAIN_DECLARATION { vec4 oPos = mul(worldViewProj, vertex); oWp = mul(worldMat, vertex); // fix pixel / texel alignment oPos.xy += texelOffsets.zw * vec2_splat(oPos.w); oUv0.xy = mul(texMat, vec4(uv0.x, uv0.y, 0.0, 1.0)).xy; oUv0.zw = oPos.zw; gl_Position = oPos; }