diff options
Diffstat (limited to 'assets/shaders/tacbody.wgsl')
| -rw-r--r-- | assets/shaders/tacbody.wgsl | 7 |
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; } |
