summaryrefslogtreecommitdiffstats
path: root/assets/shaders
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-04-22 10:51:13 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-04-22 10:51:13 -0400
commit3d3864171785c589872bf23faaaa3a421f56ee4e (patch)
tree4c4a927473ee1a58f23fff1e8ece8327a31d719a /assets/shaders
parent3dc92fad981e28c760f3c6e95f5a8153ea6c9be4 (diff)
downloadsystemic4x-3d3864171785c589872bf23faaaa3a421f56ee4e.tar.gz
systemic4x-3d3864171785c589872bf23faaaa3a421f56ee4e.tar.bz2
systemic4x-3d3864171785c589872bf23faaaa3a421f56ee4e.zip
complete orbit camera. add most large solar bodies
Diffstat (limited to 'assets/shaders')
-rw-r--r--assets/shaders/tacbody.wgsl7
1 files changed, 4 insertions, 3 deletions
diff --git a/assets/shaders/tacbody.wgsl b/assets/shaders/tacbody.wgsl
index 99392ac..62adcdd 100644
--- a/assets/shaders/tacbody.wgsl
+++ b/assets/shaders/tacbody.wgsl
@@ -38,8 +38,9 @@ fn vs_main(
let min_size = 0.025;
- //Scale the world around the camera scale.
- let instance_pos = instance.position * camera.scale;
+ //Scale the world around the camera scale and translate about the camera's
+ //absolute (/target) position
+ let instance_pos = (instance.position) * camera.scale;
let view_proj = camera.proj * view;
@@ -49,7 +50,7 @@ fn vs_main(
let vertex_dist = length(vertex_view_pos - center_view_pos) / center_view_pos.w;
if vertex_dist < min_size {
out.clip_position = center_view_pos / center_view_pos.w;
- out.clip_position += camera.proj * vec4<f32>(model.position.xy * (min_size / 2), 0.0, 0.0);
+ out.clip_position += camera.proj * vec4<f32>(model.position.xy * (min_size / 2.0), 0.0, 0.0);
}else{
out.clip_position = vertex_view_pos;
}