mirror of
https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git
synced 2025-01-10 03:08:46 +08:00
5 lines
236 B
Plaintext
5 lines
236 B
Plaintext
float rectangle_shape(vec2 uv, float width, float height){
|
|
vec2 _distance = abs(uv * 2.0 - 1.0) - vec2(width, height);
|
|
_distance = 1.0 - _distance / fwidth(_distance);
|
|
return clamp(min(_distance.x, _distance.y), 0.0, 1.0);
|
|
} |