summaryrefslogtreecommitdiff
path: root/workspaces
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-15 09:46:35 +0100
committerskal <pascal.massimino@gmail.com>2026-02-15 09:46:35 +0100
commitceb2fcf2262858ccf8d8294d6b344b652ebc27bb (patch)
tree06f28dfd70c22630259c0ef45fee73c2f3a14bc6 /workspaces
parentfc13841a40f5d7cf0a3b191f254c4dc89cea85ba (diff)
fix(shader): add dfWithID to sdf_test.wgsl for test compatibility
SDFTestEffect was failing with undefined dfWithID error. The raymarching.wgsl include requires dfWithID even for single-pass effects. Added dummy implementation that wraps df() for compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'workspaces')
-rw-r--r--workspaces/main/shaders/sdf_test.wgsl9
1 files changed, 9 insertions, 0 deletions
diff --git a/workspaces/main/shaders/sdf_test.wgsl b/workspaces/main/shaders/sdf_test.wgsl
index 3c97613..71310f2 100644
--- a/workspaces/main/shaders/sdf_test.wgsl
+++ b/workspaces/main/shaders/sdf_test.wgsl
@@ -22,6 +22,15 @@ fn df(p: vec3<f32>) -> f32 {
return min(d_sphere, d_box);
}
+// Two-pass distance function (required by raymarching.wgsl)
+fn dfWithID(p: vec3<f32>) -> RayMarchResult {
+ var result: RayMarchResult;
+ result.distance = df(p);
+ result.distance_max = result.distance;
+ result.object_id = 0.0;
+ return result;
+}
+
// Simple lighting
fn shade(pos: vec3<f32>, rd: vec3<f32>) -> vec3<f32> {
let n = normal(pos);