Water is in ECS; water material is created in code

This commit is contained in:
2025-09-03 05:31:13 +03:00
parent 847aab6ed0
commit aca04ff621
8 changed files with 324 additions and 168 deletions

14
water/depth.frag Normal file
View File

@@ -0,0 +1,14 @@
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;
}