From 9a57dabe1ae473fe35bafa2f80e2d7f1702c264b Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 14:52:04 +0100 Subject: feat(3d): Use procedural grid for floor and revert object noise - Reverted test_3d_render to use the global 'noise' texture for floating objects, restoring their bump mapping. - Implemented a procedural grid directly in the fragment shader for rasterized objects (floor). - Inverted the grid color scheme (black lines on a lighter background) as requested. - This ensures accurate object bump mapping and clear shadow visibility on the floor without requiring multiple texture bindings. --- src/gpu/effects/hybrid_3d_effect.cc | 6 ++++++ src/gpu/effects/hybrid_3d_effect.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/gpu/effects') diff --git a/src/gpu/effects/hybrid_3d_effect.cc b/src/gpu/effects/hybrid_3d_effect.cc index 51dec52..af956cd 100644 --- a/src/gpu/effects/hybrid_3d_effect.cc +++ b/src/gpu/effects/hybrid_3d_effect.cc @@ -14,6 +14,12 @@ Hybrid3DEffect::Hybrid3DEffect(WGPUDevice device, WGPUQueue queue, (void)format; // Passed to base, not directly used here. } +void Hybrid3DEffect::resize(int width, int height) { + width_ = width; + height_ = height; + renderer_.resize(width_, height_); +} + void Hybrid3DEffect::init(MainSequence* demo) { (void)demo; WGPUTextureFormat format = diff --git a/src/gpu/effects/hybrid_3d_effect.h b/src/gpu/effects/hybrid_3d_effect.h index ef62883..8eedeb2 100644 --- a/src/gpu/effects/hybrid_3d_effect.h +++ b/src/gpu/effects/hybrid_3d_effect.h @@ -18,6 +18,7 @@ class Hybrid3DEffect : public Effect { void init(MainSequence* demo) override; void render(WGPURenderPassEncoder pass, float time, float beat, float intensity, float aspect_ratio) override; + void resize(int width, int height) override; private: Renderer3D renderer_; -- cgit v1.2.3