Last active
November 7, 2020 17:13
-
-
Save lucasvanmol/eaae456879aeefaf242f90af688d2871 to your computer and use it in GitHub Desktop.
Simple shader to rotate UV space
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
| shader_type canvas_item; | |
| uniform float ANGLE = 0.0; | |
| uniform vec2 CENTER = vec2(0.5); | |
| uniform float TILING = 3.0; | |
| void fragment() { | |
| vec2 uv = (UV - CENTER)*TILING; | |
| mat2 rot = mat2( | |
| vec2( cos(ANGLE), -sin(ANGLE) ), | |
| vec2( sin(ANGLE), cos(ANGLE))); | |
| uv = rot * uv + CENTER; | |
| COLOR = vec4(fract(uv), 0.0, 1.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment