diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-03 19:47:52 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-03 19:47:52 +0100 |
| commit | 4fe647e13e3483e7fe01e6466c3871a20892963f (patch) | |
| tree | 08a82bd669541a9e3b2a976533959372de1b239e /src/3d/object.h | |
| parent | 3108fb0065a51dfc3548836ea16b287e92cd8881 (diff) | |
fix: Implement proper skybox rendering with Perlin noise
- Added ObjectType::SKYBOX for dedicated skybox rendering.
- Created assets/final/shaders/skybox.wgsl for background rendering.
- Implemented a two-pass rendering strategy in Renderer3D::render:
- First pass renders the skybox without depth writes.
- Second pass renders scene objects with depth testing.
- Corrected GlobalUniforms struct in common_uniforms.wgsl and src/3d/renderer.h to include and explicit padding for 112-byte alignment.
- Updated Renderer3D::update_uniforms to set the new and zero-initialize padding.
- Reverted sky sampling logic in renderer_3d.wgsl to for SDF misses, preventing background bleed-through.
- Updated test_3d_render.cc to include a SKYBOX object with Perlin noise.
handoff(Gemini): The skybox is now correctly rendered with Perlin noise as a dedicated background pass. Objects render correctly without transparency to the sky. All necessary C++ and WGSL shader changes are implemented and verified.
Diffstat (limited to 'src/3d/object.h')
| -rw-r--r-- | src/3d/object.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/3d/object.h b/src/3d/object.h index ccbb1e1..2099a5c 100644 --- a/src/3d/object.h +++ b/src/3d/object.h @@ -11,7 +11,8 @@ enum class ObjectType { SPHERE, PLANE, TORUS, - BOX + BOX, + SKYBOX // Add more SDF types here }; |
