OGRE_NATIVE_GLSL_VERSION_DIRECTIVE #include OGRE_UNIFORMS( uniform vec3 cameraPosition; ) MAIN_PARAMETERS IN(vec4 position, POSITION) IN(vec3 positionWS, TEXCOORD0) MAIN_DECLARATION { highp float depth = length(positionWS - cameraPosition); vec4 depthv = vec4(depth / 256.0, depth / 500.0, depth / 1000.0, 1.0); gl_FragColor = depthv; }