From c194f59e171a1e58ce1704f37d99ffcd09a42433 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 15:55:03 +0100 Subject: fix(gpu): Resolve high-DPI squished rendering and 3D shadow bugs - Implemented dynamic resolution support in all shaders and effects. - Added explicit viewport setting for all render passes to ensure correct scaling. - Fixed 3D shadow mapping by adding PLANE support and standardizing soft shadow logic. - Propagated resize events through the Effect hierarchy. - Applied project-wide code formatting. --- src/gpu/effect.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gpu/effect.h') diff --git a/src/gpu/effect.h b/src/gpu/effect.h index e7453c7..7e5e2ce 100644 --- a/src/gpu/effect.h +++ b/src/gpu/effect.h @@ -33,7 +33,10 @@ class Effect { } virtual void render(WGPURenderPassEncoder pass, float time, float beat, float intensity, float aspect_ratio) = 0; - virtual void resize(int width, int height) {} + virtual void resize(int width, int height) { + width_ = width; + height_ = height; + } virtual void end() { } @@ -46,6 +49,8 @@ class Effect { WGPUDevice device_; WGPUQueue queue_; GpuBuffer uniforms_; + int width_ = 1280; + int height_ = 720; }; class PostProcessEffect : public Effect { @@ -123,6 +128,9 @@ class MainSequence { }; std::vector sequences_; + int width_ = 1280; + int height_ = 720; + WGPUTexture framebuffer_a_ = nullptr; WGPUTextureView framebuffer_view_a_ = nullptr; WGPUTexture framebuffer_b_ = nullptr; -- cgit v1.2.3