DYT/Tool/osgOcean/bin/resources/shaders/osgOcean_heightmap.frag

16 lines
376 B
GLSL
Raw Normal View History

2024-11-22 15:19:31 +00:00
// osgOcean uniforms
// -------------------
uniform float osgOcean_WaterHeight;
// -------------------
varying vec4 vWorldVertex;
void main(void)
{
// Store the water depth
// maximum possible depth is 500,
// (a higher water depth value would not have a visible effect anyway)
gl_FragDepth = clamp((osgOcean_WaterHeight - vWorldVertex.z) / 500.0, 0.0, 1.0);
return;
}