summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2022-10-13 10:09:24 -0400
committerMicha White <botahamec@outlook.com>2022-10-13 10:09:24 -0400
commit121dc57f0962f27ab9e5da2ec05d3a1b1d97cdb2 (patch)
treea38d541ec8f7c8c23e0324b54d18ffbfa664d762 /shaders
parent0cb5bb79987ee60c49271e2905380500c75e762f (diff)
Rotate instances in the clockwise direction
Diffstat (limited to 'shaders')
-rw-r--r--shaders/sprite.wgsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/sprite.wgsl b/shaders/sprite.wgsl
index 5a00e24..43f494e 100644
--- a/shaders/sprite.wgsl
+++ b/shaders/sprite.wgsl
@@ -27,7 +27,8 @@ fn vs_main(model: VertexInput, instance: InstanceInput) -> VertexOutput {
var out: VertexOutput;
// rotate the sprite
- let a = vec2<f32>(cos(instance.rotation), sin(instance.rotation));
+ let rotation = -instance.rotation;
+ let a = vec2<f32>(cos(rotation), sin(rotation));
let b = vec2<f32>(-a[1], a[0]);
let rotation = mat2x2<f32>(a, b);
let rotated = rotation * model.position;