-
-
Save baptistebriel/f0fa471ee4614f698e32f20e0674a1ca to your computer and use it in GitHub Desktop.
Rotate uv in fragment shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec2 uvRotate (vec2 baseUv, float angle, vec2 center) { | |
vec2 uv = baseUv; | |
uv -= center; | |
mat2 m = mat2(cos(angle), -sin(angle), sin(angle), cos(angle)); | |
uv = m * uv; | |
uv += center; | |
return uv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment