mirror of
https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git
synced 2025-01-09 02:43:25 +08:00
7 lines
272 B
Plaintext
7 lines
272 B
Plaintext
vec2 spherize_uv(vec2 uv, vec2 center, float strength, vec2 offset){
|
|
vec2 _delta = uv - center;
|
|
float _delta2 = dot(_delta.xy, _delta.xy);
|
|
float _delta4 = _delta2 * _delta2;
|
|
vec2 _delta_offset = vec2(_delta4 * strength);
|
|
return uv + _delta * _delta_offset + offset;
|
|
} |