Files
ogre-prototype/water/depth.frag

15 lines
318 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
{
vec4 depth = vec4(length(positionWS - cameraPosition), 0.0, 0.0, 1.0);
gl_FragColor = depth;
}