#ifdef GL_ES precision mediump int; precision highp float; #endif #define USE_OGRE_FROM_FUTURE #include OGRE_UNIFORMS( uniform vec3 uLightPosition; uniform float uLightFarClipDistance; ) MAIN_PARAMETERS IN(vec3 oPos, TEXCOORD0) MAIN_DECLARATION { float depth = length(oPos - uLightPosition) / uLightFarClipDistance; gl_FragColor = vec4(depth, depth, depth, 1); }