From 3d3864171785c589872bf23faaaa3a421f56ee4e Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 Apr 2026 10:51:13 -0400 Subject: complete orbit camera. add most large solar bodies --- assets/shaders/tacbody.wgsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'assets/shaders') 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(model.position.xy * (min_size / 2), 0.0, 0.0); + out.clip_position += camera.proj * vec4(model.position.xy * (min_size / 2.0), 0.0, 0.0); }else{ out.clip_position = vertex_view_pos; } -- cgit v1.2.3