This commit is contained in:
2024-06-01 14:44:18 +02:00
parent 52d3ca3c61
commit 0004cddea6
11 changed files with 447 additions and 31 deletions

View File

@@ -31,6 +31,11 @@ float fill(float x, float size) {
return 1.-step(size, x);
}
float stroke(in float x_coor, float s, float width){
float d = step(s,x_coor+width*.5)-step(s,x_coor-width*.5);
return clamp(d, 0.,1.);
}
void main() {
vec2 st = gl_FragCoord.xy/u_resolution;
vec3 color = vec3(0.0,0.0,0.0);
@@ -41,6 +46,10 @@ void main() {
//i don't understand what happens here
//it has to be fract causing this to look like that
color *= step(.5,fract(cross*4.));
color *= step(1.,cross);
color += fill(cross,.5);
color += stroke(rect,.65,.05);
color += stroke(rect,.75,.025);
gl_FragColor = vec4(color, alpha);
}