fix(shadow): make Étape 14 shadow visible

The shadow pass was correct but the demo light was much too steep (52°
elevation), so the blocker's shadow fell in a ~0.5-unit sliver tight against
the cube's base and was invisible against the bright ground (offscreen pixel
probe found a single dark pixel). Verified with an offscreen probe using the
real Renderer::render_scene + shadow path:
  - steep front light   (0.6,1.1,0.6)  -> 1 dark pixel   (no visible shadow)
  - shallow side light  (1.0,0.3,0.0)  -> 17 107 pixels  (shadow pipeline OK)
  - tuned front-right   (1.0,0.5,0.0)  -> 16 979 pixels  (clear visible shadow)

The azimuth matters most: from the elevated front-right camera, a shadow cast
toward -z falls behind the cube and is occluded; one cast toward -x runs across
the ground to the left of the cube and reads clearly. Tuned light therefore sits
front-right and low (toward_light (1.0,0.5,0.0)), keeping the front faces lit
while casting a clearly visible PCF-softened shadow.

Also reapply the LessEqual comparison sampler fix (commit 39167ee had set it,
but was later reverted to GreaterEqual by 9a51ff7 while debugging; the probe
confirms LessEqual is the correct, non-inverted test). Correct 'rotating cube'
to 'cube' in README/ROADMAP (shadow_test scene is static).
This commit is contained in:
Jérôme Bousquié
2026-09-19 21:12:25 +02:00
parent bfe68f4393
commit ab13fa725e
4 changed files with 21 additions and 14 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ generated: { by: human:jerome, at: 2026-07-31T00:00:00Z }
+ pipeline ombre dans le `Renderer` (shadow map 1024² Depth32Float, bias slope-scaled) ; pass
`render_shadow_map` en tête de `render_scene` ; PCF 3×3 + comparateur dans `standard_shader.wgsl`
(groupe @3 partagé, lié mais non échantillonné quand désactivé → non-régression). Ombres **éteintes
par défaut**. Exemple `shadow_test` : cube tournant projetant une ombre sur un sol.)*
par défaut**. Exemple `shadow_test` : cube projetant une ombre douce sur un sol.)*
### 4.3 Optimisations
- [ ] Batching par Material (réduction des state changes GPU)