canvas2 = shader({
width:300,
height: 600,
iTime: true,
visibility,
uniforms: { amp: "float", frec: "float" }
})`
void mainImage(out vec4 fragColor,in vec2 fragCoord) {
vec2 st = fragCoord.xy/iResolution.xy;
st.x *= iResolution.x/iResolution.y;
vec3 color = vec3(0.0);
float d = 0.0;
// Remap the space to -1. to 1.
st = st *amp-0.2;
// Make the distance field
// d = length( abs(st)-.2 );
d = length( abs(st));
// d = length( min(abs(st)-.3,0.) );
// d = length( max(abs(st)-.3,0.) );
// Visualize the distance field
fragColor = vec4(vec3(fract(d*10.0)),1.0);
// Drawing with the distance field
//fragColor = vec4(vec3( step(.3,d) ),1.0);
//fragColor = vec4(vec3( step(.3,d) * step(d,.4)),1.0);
// fragColor = vec4(vec3( smoothstep(.3,.4,d)* smoothstep(.6,.5,d)) ,1.0);
}
`