void main(){ vec2 st = gl_FragCoord.xy/u_resolution.xy; vec3 color = vec3(0.0);
// Each result will return 1.0 (white) or 0.0 (black). float left = step(0.1,st.x); // Similar to ( X greater than 0.1 ) float bottom = step(0.1,st.y); // Similar to ( Y greater than 0.1 )
// The multiplication of left*bottom will be similar to the logical AND. color = vec3( left * bottom );
void main(){ vec2 st = gl_FragCoord.xy/u_resolution; float pct = 0.0;
// a. The DISTANCE from the pixel to the center pct = distance(st,vec2(0.5));
// b. The LENGTH of the vector // from the pixel to the center // vec2 toCenter = vec2(0.5)-st; // pct = length(toCenter);
// c. The SQUARE ROOT of the vector // from the pixel to the center // vec2 tC = vec2(0.5)-st; // pct = sqrt(tC.x*tC.x+tC.y*tC.y); float clipRes = 1.-step(0.5,pct);
vec3 color = vec3(pct); // color = vec3(1.-clipRes*pct);
void main(){ vec2 st = gl_FragCoord.xy/u_resolution.xy; vec3 color = vec3(0.0);
vec2 pos = vec2(0.5)-st; // -0.5~0.5
float r = length(pos)*2.0; float a = atan(pos.y,pos.x);
float f = cos(a*3.); f = abs(cos(a*3.)); f = abs(cos(a*2.5))*0.236+0.116; f = abs(cos(a*12.)*sin(a*3.))*.8+.1; f = smoothstep(-.5,1., cos(a*10.))*0.2+0.5;
//color = vec3(smoothstep(f,f+.01,r)); color = vec3(1.-smoothstep(f,f+0.01,r) );