From e05392919e0c87c2a192ce4fe69d0b275b5386c0 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 5 Nov 2026 15:35:39 +0100 Subject: [PATCH] Brighter lava surface, glow and lights Co-Authored-By: Claude Opus 5.5 --- src/render3d.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render3d.rs b/src/render3d.rs index 4cb0340..487b39c 100644 --- a/src/render3d.rs +++ b/src/render3d.rs @@ -284,12 +284,12 @@ void main() { // light rippling over the surface: glints on water; lava glows by itself and pulses if (liquid) { if (color.a < 0.5) { - light = max(light, vec3(1.45, 1.3, 1.2)) * (1.0 + wave * 0.18); + light = max(light, vec3(1.9, 1.65, 1.45)) * (1.0 + wave * 0.18); } else { light *= 1.0 + wave * 0.28; } } - gl_FragColor = vec4(tex.rgb * min(light, vec3(1.9)), 1.0); + gl_FragColor = vec4(tex.rgb * min(light, vec3(liquid && color.a < 0.5 ? 2.4 : 1.9)), 1.0); } "#; @@ -479,7 +479,7 @@ fn amb_at(f: &[f32], x: f32, z: f32) -> f32 { // ---- lava light: an orange glow up to LAVA_REACH tiles around lava, fading with the distance const LAVA_REACH: f32 = 10.0; -const LAVA_LIGHT: Vec3 = Vec3::new(1.05, 0.45, 0.08); // added light at full strength (next to the lava) +const LAVA_LIGHT: Vec3 = Vec3::new(1.3, 0.56, 0.1); // added light at full strength (next to the lava) // glow per tile: 1 on lava, falling to 0 at LAVA_REACH tiles. The light spreads over open ground // (walls are lit on their faces but do not let it through). @@ -1134,7 +1134,7 @@ impl R3d { for x in (ccx - r).max(0)..(ccx + r).min(mw() as i32) { if x % 3 == 0 && g.map.t[idx(x, z)].kind == Kind::Lava { let fl = 0.8 + 0.2 * (t * 2.0 + (x * 7 + z * 3) as f32).sin(); - push(vec3(x as f32 + 0.5, 0.3, z as f32 + 0.5), 5.0, vec3(1.0, 0.45, 0.12), 1.3 * fl, 0.0); + push(vec3(x as f32 + 0.5, 0.3, z as f32 + 0.5), 5.5, vec3(1.0, 0.45, 0.12), 1.7 * fl, 0.0); } } }