7 #include "light_clearskies_stddef.glsl"
8 #include "common_scene.glsl"
13 float water_depth( vec3 pos, vec3 halfview )
15 vec3 pnorm = g_water_plane.xyz;
16 float pdist = g_water_plane.w;
18 float d = dot( pnorm, halfview );
19 float t = dot((pnorm*pdist - pos), pnorm) / d;
20 return t * g_water_fog;
25 vec3 halfview = normalize( uCamera - aWorldCo );
26 float depth = water_depth( aWorldCo, halfview );
27 FragColor = vec4( depth, 0.0, 0.0, 0.0 );