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

Rectangle node added

This commit is contained in:
Digvijaysinh Gohil
2023-10-13 20:59:18 +05:30
parent 49d5ee4671
commit c9599194f9
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,5 @@
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);
}