fix(assets): review fixes — spec alpha ranges and noise symmetry

Sync fog-shader-spec.md with actual shader values after #563 tuning:
light fog 0.25-0.35 (was 0.26-0.34), deep fog 0.55-0.70 (was 0.54-0.70).
Pseudocode now uses symmetric noise remapping (noise*2-1)*amp to match
the shader. Added first-call guard comment on _tint_bytes in fog_state.gd.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 20:04:10 +01:00
co-authored by Claude Opus 4.6
parent 04c2eb362a
commit 552c90a264
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ func _ready() -> void:
func _resize(bounds: Rect2i) -> void:
var old_bounds := map_bounds
var old_exp := _exp_bytes
var old_tint := _tint_bytes
var old_tint := _tint_bytes # empty on first call (_ready); guard at line 104 skips copy
var old_w := _width
var old_h := _height
+7 -7
View File
@@ -12,13 +12,13 @@ The fog system was simplified from the original 5-layer spec in Sprint 22 (#569)
|----------------------|------------------|-------|
| 1. Clear (forward cone) | Implemented | Soft Gaussian gradient (7x7, sigma 2.0) |
| 2. Light fog (peripheral sector) | Simplified — merged into gradient | Peripheral sector removed from server; gradient provides soft transition |
| 3. Deep fog (previously explored) | Implemented — EXP_EXPLORED | Alpha 0.54-0.70 with zone temperature tint (#563) |
| 3. Deep fog (previously explored) | Implemented — EXP_EXPLORED | Alpha 0.55-0.70 with zone temperature tint (#563) |
| 4. Unexplored + maps app | Deferred | v0.1.2+, requires mapped_tiles in ObserverSnapshot |
| 5. Unexplored (no maps) | Implemented | Solid near-black #12141a |
**Alpha values (Sprint 22, #563):**
- Light fog zone (near cone gradient, vis 0.0-0.3): alpha 0.26-0.34, breathing ±0.04 (8-10s)
- Deep fog zone (EXP_EXPLORED, vis≈0): alpha 0.54-0.70, breathing ±0.08 (15-20s)
- Light fog zone (near cone gradient, vis 0.0-0.3): alpha 0.25-0.35, breathing ±0.05 (8-10s)
- Deep fog zone (EXP_EXPLORED, vis≈0): alpha 0.55-0.70, breathing ±0.075 (15-20s)
- Zone temperature tint active in deep fog zone (D-059/D-046/D-077)
## Overview
@@ -131,10 +131,10 @@ float noise_fast = texture(noise_tex, tile * 0.03 + vec2(time * 0.11, time * 0.0
// Deep fog noise — slow cycle (15-20s), more pronounced ±0.08 breathing
float noise_slow = texture(noise_tex, tile * 0.02 + vec2(time * 0.05, time * 0.035)).r;
// Light fog: alpha 0.26-0.34 (near cone gradient)
float light_fog_alpha = 0.30 + noise_fast * 0.04;
// Deep fog: alpha 0.54-0.70 (far from cone, EXP_EXPLORED)
float deep_fog_alpha = 0.62 + noise_slow * 0.08;
// Light fog: alpha 0.25-0.35 (near cone gradient)
float light_fog_alpha = 0.30 + (noise_fast * 2.0 - 1.0) * 0.05;
// Deep fog: alpha 0.55-0.70 (far from cone, EXP_EXPLORED)
float deep_fog_alpha = 0.625 + (noise_slow * 2.0 - 1.0) * 0.075;
// Blend deep <-> light fog by proximity to cone:
// vis=0 (far from cone) → deep_factor=1 → deep fog color + alpha