diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-23 00:26:52 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-23 00:26:52 +0100 |
| commit | 1470dd240f48652d1fe97957fe44a49b0e1ee9a6 (patch) | |
| tree | c202e36a2aaed35fd8bc111457bcba89c7db8658 /cnn_v3/src/gbuffer_effect.cc | |
| parent | 12d5d5f1762a0c00405950b6ff5e564880f0ff36 (diff) | |
wip(cnn_v3): shadow→dif intermediate + scene tweaks + migration plan
- gbuf_shadow.wgsl: normal bias 0.05→0.02
- gbuf_pack.wgsl: compute dif=diffuse*shadow, drop shadow from t1.z,
store dif in t1.w (INTERMEDIATE — incorrect packing, see migration plan)
- gbuf_deferred.wgsl: read dif from t1.w.x (matches intermediate packing)
- gbuf_view.wgsl: expand to 4×6 grid, show dif.r/g/b in row 5
(INTERMEDIATE — to be reverted to 4×5 with ch18=dif)
- gbuffer_effect.cc: add small hovering sphere (r=0.6) above scene;
swap cube/sphere positions; both spheres pulsate
- docs/GBUF_DIF_MIGRATION.md: full migration plan with checklist
handoff(Claude): intermediate commit — GBUF_DIF_MIGRATION.md §Current State
describes what is wrong and the full implementation checklist (5 steps).
Diffstat (limited to 'cnn_v3/src/gbuffer_effect.cc')
| -rw-r--r-- | cnn_v3/src/gbuffer_effect.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cnn_v3/src/gbuffer_effect.cc b/cnn_v3/src/gbuffer_effect.cc index 829c199..25fef4c 100644 --- a/cnn_v3/src/gbuffer_effect.cc +++ b/cnn_v3/src/gbuffer_effect.cc @@ -116,7 +116,7 @@ void GBufferEffect::set_scene() { // 2 large static cubes for shadow debugging. { Object3D obj(ObjectType::CUBE); - obj.position = vec3(-1.0f, 0.0f, 0.0f); + obj.position = vec3(1.0f, 0.0f, 0.0f); obj.scale = vec3(0.6f, 0.6f, 0.6f); obj.color = vec4(0.9f, 0.5f, 0.3f, 1.0f); scene_.add_object(obj); @@ -124,7 +124,7 @@ void GBufferEffect::set_scene() { } { Object3D obj(ObjectType::SPHERE); - obj.position = vec3(1.0f, 0.0f, 0.0f); + obj.position = vec3(-1.0f, 0.0f, 0.0f); const float r = 0.9f; obj.scale = vec3(r, r, r); obj.color = vec4(0.3f, 0.6f, 0.9f, 1.0f); @@ -133,7 +133,17 @@ void GBufferEffect::set_scene() { sphere_anims_.push_back({idx, r}); } - // (sphere removed for shadow debugging) + // Second sphere: small, hovering above both objects, pulsating. + { + Object3D obj(ObjectType::SPHERE); + obj.position = vec3(0.0f, 2.2f, 0.0f); + const float r = 0.6f; + obj.scale = vec3(r, r, r); + obj.color = vec4(0.9f, 0.8f, 0.2f, 1.0f); + const int idx = (int)scene_.objects.size(); + scene_.add_object(obj); + sphere_anims_.push_back({idx, r}); + } // Camera: above and in front of the scene, looking at origin. camera_.set_look_at(vec3(0.0f, 2.5f, 6.0f), |
