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

10 lines
289 B
Plaintext
Raw Normal View History

2023-10-12 19:28:04 +05:30
vec2 twirl_uv(vec2 uv, vec2 center, float strength, vec2 offset){
vec2 _delta = uv - center;
float _angle = strength * length(_delta);
mat2 _rotation = mat2(
vec2(cos(_angle), -sin(_angle)),
vec2(sin(_angle), cos(_angle))
);
_delta = _rotation * _delta;
return _delta + center;
2023-10-12 19:28:04 +05:30
}