diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-28 02:39:04 +0100 |
| commit | 472c2258dbeca000a454ea1781f09df63477563e (patch) | |
| tree | 98ac75c3824f19f4a598a807b3cb6aa13e8cb0c3 /common/shaders/render/scene_query_linear.wgsl | |
| parent | 1c5a9fb7b8c704a59ec58894adf46d73d1615072 (diff) | |
replace wgsl type: vec4<f32> -> vec4f ..
Diffstat (limited to 'common/shaders/render/scene_query_linear.wgsl')
| -rw-r--r-- | common/shaders/render/scene_query_linear.wgsl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/shaders/render/scene_query_linear.wgsl b/common/shaders/render/scene_query_linear.wgsl index 0497a40..5864b6f 100644 --- a/common/shaders/render/scene_query_linear.wgsl +++ b/common/shaders/render/scene_query_linear.wgsl @@ -1,17 +1,17 @@ #include "math/sdf_shapes" #include "math/sdf_utils" -fn get_dist(p: vec3<f32>, obj_params: vec4<f32>) -> 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<f32>(1.0)); } // Unit Box - if (obj_type == 3.0) { return sdTorus(p, vec2<f32>(1.0, 0.4)); } // Unit Torus - if (obj_type == 4.0) { return sdPlane(p, vec3<f32>(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<f32>, skip_idx: u32) -> f32 { +fn map_scene(p: vec3f, skip_idx: u32) -> f32 { var d = 1000.0; @@ -23,7 +23,7 @@ fn map_scene(p: vec3<f32>, skip_idx: u32) -> f32 { let obj = object_data.objects[i]; - let q = (obj.inv_model * vec4<f32>(p, 1.0)).xyz; + let q = (obj.inv_model * vec4f(p, 1.0)).xyz; |
