16 lines
378 B
GLSL
16 lines
378 B
GLSL
OGRE_NATIVE_GLSL_VERSION_DIRECTIVE
|
|
#include <OgreUnifiedShader.h>
|
|
|
|
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;
|
|
}
|