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:
5
addons/ShaderLib/Procedural/Shapes/Rectangle.gdshaderinc
Normal file
5
addons/ShaderLib/Procedural/Shapes/Rectangle.gdshaderinc
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user