diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-01 16:02:59 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-01 16:02:59 -0400 |
| commit | b14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0 (patch) | |
| tree | 68d47ea946136025890265cc2185a728e4593b96 /assets/shaders/tacmap/body.wgsl | |
| parent | 961f8c6d405c9c6fcf9aaf4fb6f199b0e5c60d88 (diff) | |
| download | systemic4x-b14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0.tar.gz systemic4x-b14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0.tar.bz2 systemic4x-b14dd1c1f3e198137fa8b9e0c4f5e56949b11cd0.zip | |
i don't know how to get the line segments to render right
Diffstat (limited to 'assets/shaders/tacmap/body.wgsl')
| -rw-r--r-- | assets/shaders/tacmap/body.wgsl | 15 |
1 files changed, 13 insertions, 2 deletions
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<f32>, - @location(1) radius: f32 + @location(1) origin: vec3<f32>, + @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<f32>(0.0, 0.0, 0.0, 1.0); + return out; + } + } + + let instance_pos = relative_pos + origin_pos; let view_proj = camera.proj * view; |
