From a109983c194c45ad85f0e481232bc605c7cfd85b Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 08:34:24 +0100 Subject: Remediation: Implement shared common/shaders/ directory Eliminates 36 duplicate shader files across workspaces. Structure: - common/shaders/{math,render,compute}/ - Shared utilities (20 files) - workspaces/*/shaders/ - Workspace-specific only Changes: - Created common/shaders/ with math, render, compute subdirectories - Moved 20 common shaders from workspaces to common/ - Removed duplicates from test workspace - Updated assets.txt: ../../common/shaders/ references - Enhanced asset_packer.cc: filesystem path normalization for ../ resolution Implementation: Option 1 from SHADER_REUSE_INVESTIGATION.md - Single source of truth for common code - Workspace references via relative paths - Path normalization in asset packer handoff(Claude): Common shader directory implemented --- workspaces/main/shaders/math/sdf_shapes.wgsl | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 workspaces/main/shaders/math/sdf_shapes.wgsl (limited to 'workspaces/main/shaders/math/sdf_shapes.wgsl') diff --git a/workspaces/main/shaders/math/sdf_shapes.wgsl b/workspaces/main/shaders/math/sdf_shapes.wgsl deleted file mode 100644 index 31bbe2d..0000000 --- a/workspaces/main/shaders/math/sdf_shapes.wgsl +++ /dev/null @@ -1,14 +0,0 @@ -fn sdSphere(p: vec3, r: f32) -> f32 { - return length(p) - r; -} -fn sdBox(p: vec3, b: vec3) -> f32 { - let q = abs(p) - b; - return length(max(q, vec3(0.0))) + min(max(q.x, max(q.y, q.z)), 0.0); -} -fn sdTorus(p: vec3, t: vec2) -> f32 { - let q = vec2(length(p.xz) - t.x, p.y); - return length(q) - t.y; -} -fn sdPlane(p: vec3, n: vec3, h: f32) -> f32 { - return dot(p, n) + h; -} -- cgit v1.2.3