1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-09-20 04:15:58 +08:00
Files
Godot-Shader-Lib/addons/ShaderLib/UV/SwirlUV.gdshaderinc

10 lines
302 B
Plaintext
Raw Normal View History

2023-12-10 17:46:18 +05:30
vec2 swirl_uv(vec2 uv, vec2 center, float strength, vec2 offset){
vec2 _delta = uv - center;
float _angle = strength * pow(1. - length(_delta), 3);
mat2 _rotation = mat2(
vec2(cos(_angle), -sin(_angle)),
vec2(sin(_angle), cos(_angle))
);
_delta = _rotation * _delta;
return _delta + center;
2023-12-10 17:46:18 +05:30
}