From 25dc87528915fb0fd89181333324b215d77ad014 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 21 Feb 2026 08:42:13 +0100 Subject: refactor(wgsl): Factorize getScreenCoord helper Factorizes the screen coordinate calculation from scene1.wgsl into a reusable getScreenCoord function in common/shaders/math/common_utils.wgsl. This improves code reuse and simplifies fragment shaders. --- doc/COMPLETED.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc') diff --git a/doc/COMPLETED.md b/doc/COMPLETED.md index 72e389d..0dba307 100644 --- a/doc/COMPLETED.md +++ b/doc/COMPLETED.md @@ -29,6 +29,16 @@ Detailed historical documents have been moved to `doc/archive/` for reference: Use `read @doc/archive/FILENAME.md` to access archived documents. +## Recently Completed (February 21, 2026) + +- [x] **WGSL Refactor: getScreenCoord Helper** + - **Goal**: Factorize boilerplate screen coordinate calculation into a reusable helper function. + - **Implementation**: + - Created `getScreenCoord(p, resolution)` function in `common/shaders/math/common_utils.wgsl`. It takes a fragment position and resolution, and returns aspect-corrected normalized device coordinates. + - Updated `workspaces/main/shaders/scene1.wgsl` to `#include "math/common_utils.wgsl"` and replaced the manual coordinate calculation with a call to the new helper. + - **Impact**: Reduces code duplication and simplifies fragment shaders. + - **Files**: `common/shaders/math/common_utils.wgsl`, `workspaces/main/shaders/scene1.wgsl`. + ## Recently Completed (February 20, 2026) - [x] **Port Scene1Effect + Fix seq_compiler Timing Bug** -- cgit v1.2.3