From 8fd3eda0ed069b1a817261f8f4d6a35c565b3fe4 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 22 Mar 2026 23:17:50 +0100 Subject: fix(cnn_v3): shadow pass — 5 bugs fixed, labels in gbuf_view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Camera Y-inversion: proj.m[5] = -proj.m[5] in upload_scene_data + WGPUFrontFace_CCW on raster pipeline. 2. Shadow formula: replace shadowWithStoredDistance with 64-step IQ soft shadow (8*d/t, unbounded). 3. Local→world SDF scale: d *= length(obj.model[0].xyz). 4. Shadow bias: use rasterized normal from normal_mat_tex (binding 4) instead of light direction — fixes terminator self-shadow on spheres. 5. ShaderComposer: GBufViewEffect now resolves #include via ShaderComposer::Get().Compose(). Also: per-tile channel labels in gbuf_view.wgsl via debug_str. Scene simplified to 1 cube + 1 sphere for debugging (restore TODO). Scale propagation for pulsating sphere confirmed correct end-to-end. handoff(Gemini): shadow validated. Next: restore full scene in GBufferEffect::set_scene() (20 cubes + 4 spheres, 2 lights), then run training pass per cnn_v3/docs/HOWTO.md §3. --- PROJECT_CONTEXT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'PROJECT_CONTEXT.md') diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md index d211cea..9a710f1 100644 --- a/PROJECT_CONTEXT.md +++ b/PROJECT_CONTEXT.md @@ -46,7 +46,7 @@ ## Next Up -**Active:** CNN v3 shadow pass debugging (`GBufDeferredEffect`), Spectral Brush Editor +**Active:** CNN v3 shadow ✅ fixed — restore full scene, then training pass. Spectral Brush Editor. **Ongoing:** Test infrastructure maintenance (38/38 passing) **Future:** CNN v3 training pass, size optimization (64k target) -- cgit v1.2.3