diff --git a/crates/horizon-client/src/gfx/hd.rs b/crates/horizon-client/src/gfx/hd.rs index f5caa2d0b..8070aab3c 100644 --- a/crates/horizon-client/src/gfx/hd.rs +++ b/crates/horizon-client/src/gfx/hd.rs @@ -591,10 +591,13 @@ fn fs_water(in: FullOut) -> @location(0) vec4 { } let thickness = clamp(length(position_at(uv_floor, floor_z)) - dist, 0.0, 48.0); let behind = textureSampleLevel(lit_tex, linear, uv_floor, 0.0).rgb; - let colour = clamp(tint.rgb, vec3(0.03), vec3(1.0)); + // A deep, dark water: the biome's colour darkened and a little greyed, so it reads as + // depth rather than as bright paint. + let biome = clamp(tint.rgb, vec3(0.03), vec3(1.0)); + let colour = mix(vec3(dot(biome, vec3(0.333))), biome, 0.8) * vec3(0.55, 0.68, 0.8); // The colours the water takes up fastest are the ones it has the least of. - let absorb = exp(-(vec3(1.0) - colour) * 0.8 * (thickness + 0.3)); - let refracted = behind * absorb + colour * volume_light * 0.9 * (vec3(1.0) - absorb); + let absorb = exp(-(vec3(1.0) - colour) * 1.1 * (thickness + 0.3)); + let refracted = behind * absorb + colour * volume_light * 0.6 * (vec3(1.0) - absorb); // Reflection: the screen where the ray stays on it, the sky where it leaves it or misses. var r = reflect(-v, n); diff --git a/crates/horizon-client/src/terrain.wgsl b/crates/horizon-client/src/terrain.wgsl index 0d5d2fc89..e892d5a0f 100644 --- a/crates/horizon-client/src/terrain.wgsl +++ b/crates/horizon-client/src/terrain.wgsl @@ -195,9 +195,11 @@ struct WaterOut { @fragment fn fs_water(in: TerrainOut) -> WaterOut { let layer = in.layer & 0x7fffu; if layer != WATER_STILL && layer != WATER_FLOW { discard; } - let color = sprite(in.uv, layer) * in.tint; + // The biome's colour at the texture's mean brightness, not the texture: the HD water draws + // its own surface (waves, reflections), and vanilla's ripples on top would look painted on. + let color = vec3(0.62) * in.tint.rgb; var out: WaterOut; - out.tint = vec4(color.rgb, clamp(in.lm.y, 0.0, 1.0)); + out.tint = vec4(color, clamp(in.lm.y, 0.0, 1.0)); out.normal = vec4(face_normal(in.pos) * 0.5 + 0.5, clamp(in.lm.x, 0.0, 1.0)); return out; }