From b14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 1 May 2026 16:02:59 -0400 Subject: i don't know how to get the line segments to render right --- assets/shaders/tacmap/body.wgsl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'assets/shaders/tacmap/body.wgsl') diff --git a/assets/shaders/tacmap/body.wgsl b/assets/shaders/tacmap/body.wgsl index 7156150..217a0b2 100644 --- a/assets/shaders/tacmap/body.wgsl +++ b/assets/shaders/tacmap/body.wgsl @@ -1,6 +1,7 @@ struct InstanceInput { @location(0) position: vec3, - @location(1) radius: f32 + @location(1) origin: vec3, + @location(2) radius: f32 }; struct VertexOutput { @@ -47,7 +48,17 @@ fn vs_main( //Scale the world around the camera scale and translate about the camera's //absolute (/target) position - let instance_pos = (instance.position - camera.pos) * camera.scale; + let relative_pos = instance.position * camera.scale; + let origin_pos = (instance.origin - camera.pos) * camera.scale; + + if all(relative_pos != origin_pos) { + if length(relative_pos) < 0.01 { + out.clip_position = vec4(0.0, 0.0, 0.0, 1.0); + return out; + } + } + + let instance_pos = relative_pos + origin_pos; let view_proj = camera.proj * view; -- cgit v1.2.3