From 472c2258dbeca000a454ea1781f09df63477563e Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 28 Feb 2026 02:39:04 +0100 Subject: replace wgsl type: vec4 -> vec4f .. --- common/shaders/render/scene_query_bvh.wgsl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'common/shaders/render/scene_query_bvh.wgsl') diff --git a/common/shaders/render/scene_query_bvh.wgsl b/common/shaders/render/scene_query_bvh.wgsl index 3e6f895..cf2136b 100644 --- a/common/shaders/render/scene_query_bvh.wgsl +++ b/common/shaders/render/scene_query_bvh.wgsl @@ -2,25 +2,25 @@ #include "math/sdf_utils" struct BVHNode { - min: vec3, + min: vec3f, left_idx: i32, - max: vec3, + max: vec3f, obj_idx_or_right: i32, }; @group(0) @binding(2) var bvh_nodes: array; -fn get_dist(p: vec3, obj_params: vec4) -> f32 { +fn get_dist(p: vec3f, obj_params: vec4f) -> f32 { let obj_type = obj_params.x; if (obj_type == 1.0) { return length(p) - 1.0; } // Unit Sphere - if (obj_type == 2.0) { return sdBox(p, vec3(1.0)); } // Unit Box - if (obj_type == 3.0) { return sdTorus(p, vec2(1.0, 0.4)); } // Unit Torus - if (obj_type == 4.0) { return sdPlane(p, vec3(0.0, 1.0, 0.0), 0.0); } + if (obj_type == 2.0) { return sdBox(p, vec3f(1.0)); } // Unit Box + if (obj_type == 3.0) { return sdTorus(p, vec2f(1.0, 0.4)); } // Unit Torus + if (obj_type == 4.0) { return sdPlane(p, vec3f(0.0, 1.0, 0.0), 0.0); } if (obj_type == 5.0) { return sdBox(p, obj_params.yzw); } // MESH AABB return 100.0; } -fn map_scene(p: vec3, skip_idx: u32) -> f32 { +fn map_scene(p: vec3f, skip_idx: u32) -> f32 { var d = 1000.0; var stack: array; var stack_ptr = 0; @@ -40,7 +40,7 @@ fn map_scene(p: vec3, skip_idx: u32) -> f32 { let obj_idx = u32(node.obj_idx_or_right); if (obj_idx == skip_idx) { continue; } let obj = object_data.objects[obj_idx]; - let q = (obj.inv_model * vec4(p, 1.0)).xyz; + let q = (obj.inv_model * vec4f(p, 1.0)).xyz; // Extract scale factors from the model matrix let sx = length(obj.model[0].xyz); -- cgit v1.2.3