From a1bdab949bf7a7e074b32daf8c06eb466afef9a0 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 28 Feb 2026 23:21:10 +0100 Subject: [PATCH] fix(assets): sync spec noise amplitudes and gradient radius MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GLSL sample comments now say ±0.05 / ±0.075 matching the code and spec table. Implementation notes gradient radius updated from 6-8 to 3-4 tiles. Co-Authored-By: Claude Opus 4.6 --- docs/architecture/fog-shader-spec.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/architecture/fog-shader-spec.md b/docs/architecture/fog-shader-spec.md index 54b68af07..6aec3836c 100644 --- a/docs/architecture/fog-shader-spec.md +++ b/docs/architecture/fog-shader-spec.md @@ -126,9 +126,9 @@ The shader determines fog state per pixel based on the visibility and exploratio Two explored sub-zones are distinguished by the blurred `vis` value (proximity to the forward cone): ```glsl -// Light fog noise — fast cycle (8-10s), subtle ±0.04 breathing +// Light fog noise — fast cycle (8-10s), subtle ±0.05 breathing float noise_fast = texture(noise_tex, tile * 0.03 + vec2(time * 0.11, time * 0.07)).r; -// Deep fog noise — slow cycle (15-20s), more pronounced ±0.08 breathing +// Deep fog noise — slow cycle (15-20s), more pronounced ±0.075 breathing float noise_slow = texture(noise_tex, tile * 0.02 + vec2(time * 0.05, time * 0.035)).r; // Light fog: alpha 0.25-0.35 (near cone gradient) @@ -252,7 +252,7 @@ Per tick (in _process or on snapshot signal): 1. **Start with the shader.** Get a basic 2-layer shader working (clear vs opaque) on a ColorRect, then incrementally add layers. 2. **Coordinate mapping is the hardest part.** Getting screen pixels → world tiles → texture UVs correct requires careful math. Test with a known map layout. 3. **Use Godot's NoiseTexture2D** resource for the Perlin noise rather than computing it in the shader. Pass it as a uniform. Scroll the UV offset with TIME for animation. -4. **The gradient edge** (Layer 1, 6-8 sim tiles) is the most visible quality differentiator. Use `smoothstep()` with the distance from the nearest non-visible tile. This may require encoding distance-to-edge in the visibility texture rather than binary 0/255. +4. **The gradient edge** (Layer 1, 3-4 tile radius via 7x7 Gaussian) is the most visible quality differentiator. Use `smoothstep()` with the distance from the nearest non-visible tile. This may require encoding distance-to-edge in the visibility texture rather than binary 0/255. 5. **Fog entities are Sprint 7+ (#431).** For this sprint, just get the 5-layer fog shader working. The FogEntities node can be empty. 6. **Test with the existing sim_bridge test mode** — it provides a visible_positions Dictionary with a 4-tile radius and Bresenham LOS. Good enough to validate the shader.