return texture( g_world_depth, depth_coord ).r;
}
+float world_water_depth( vec3 pos )
+{
+ vec2 depth_coord = (pos.xz - g_depth_bounds.xy) * g_depth_bounds.zw;
+ float ref_depth = g_water_plane.y*g_water_plane.w;
+ return texture( g_world_depth, depth_coord ).g - ref_depth;
+}
+
float shadow_sample( vec3 vdir )
{
vec3 sample_pos = aWorldCo + vdir;