#ifdef GL_ES precision mediump int; precision mediump float; #endif #include OGRE_UNIFORMS( uniform mat4 worldViewProj; uniform vec3 eyePosition; ) MAIN_PARAMETERS IN(vec4 vertex, POSITION) IN(vec4 normal, NORMAL) IN(vec2 uv0, TEXCOORD0) OUT(vec2 NDotV, TEXCOORD0) MAIN_DECLARATION { vec4 eyeDir = normalize(vec4(eyePosition - vertex.xyz, 0.0)); gl_Position = mul(worldViewProj, vertex); NDotV = vec2_splat(clamp(dot(normal, eyeDir), 0.0, 1.0)); }