utils: added translation and box shape
This commit is contained in:
@@ -5,6 +5,14 @@ vec3 circle(in vec2 _st, in float _radius, vec3 color){
|
||||
dot(dist,dist)*4.0);
|
||||
}
|
||||
|
||||
vec3 box(vec2 width, vec2 height) {
|
||||
height = vec2(0.5) - height*0.5;
|
||||
vec2 he = height+0.001;
|
||||
vec2 uv = smoothstep(height, he, width);
|
||||
uv *= smoothstep(height, he, vec2(1.0)-width);
|
||||
return vec3(uv.x*uv.y);
|
||||
}
|
||||
|
||||
// Inspired by (but modified)
|
||||
// http://thndl.com/square-shaped-shaders.html
|
||||
#define TAU 6.28318530718
|
||||
|
Reference in New Issue
Block a user