feat(world): depth-coloured water column fog and de-tiled sand ripples
A FogVolume covering the site carries a fog shader whose scattering albedo follows the same spectral transmittance as the seabed and whose density grows below the reference depth, so haze darkens and turns indigo with depth around every object; the global volumetric density moves into the volume and the far depth fog only covers what lies beyond 128 m. Sand ripples are bent by a slow domain warp, blended with a larger ripple scale and faded out between 40 and 60 m, which hides the 3.2 m tiling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
61ef4a892d
commit
d7e50f8879
11 files changed
+82
-15
No files matched your search
@@ -0,0 +1,25 @@
|
||||
shader_type fog;
|
||||
|
||||
// Water column for the volumetric fog: the scattering albedo follows the same
|
||||
// per-channel Beer-Lambert transmittance as the seabed shader, so the haze turns
|
||||
// from green-blue near the plateau to indigo at the drop-off foot, and the density
|
||||
// grows slowly with depth (more suspended sediment, less light). It covers every
|
||||
// object in the volume, not only the terrain.
|
||||
|
||||
uniform vec3 shallow_albedo : source_color = vec3(0.5, 0.78, 0.92);
|
||||
uniform vec3 water_absorption_per_m = vec3(0.11, 0.04, 0.032);
|
||||
uniform float reference_depth_m = 24.0;
|
||||
uniform float minimum_albedo = 0.03;
|
||||
uniform float base_density = 0.012;
|
||||
uniform float density_per_m = 0.00012;
|
||||
uniform float emission_strength = 0.0;
|
||||
|
||||
void fog() {
|
||||
// Above the reference depth the haze keeps its shallow colour: brightening it
|
||||
// further would wash the upper water column towards white.
|
||||
float excess_depth_m = max(-WORLD_POSITION.y - reference_depth_m, 0.0);
|
||||
vec3 transmittance = exp(-water_absorption_per_m * excess_depth_m);
|
||||
ALBEDO = clamp(shallow_albedo * transmittance, vec3(minimum_albedo), vec3(1.0));
|
||||
DENSITY = base_density + density_per_m * excess_depth_m;
|
||||
EMISSION = vec3(emission_strength);
|
||||
}
|
||||
Reference in new issue
Block a user