figured out how to create the outline, took me a while, spend a bunch of time multing 2 vecs without understanding the result

This commit is contained in:
2024-05-23 16:32:04 +02:00
parent 7382b344c6
commit 95165dc4a2

View File

@@ -38,17 +38,23 @@ void main() {
//even simpler //even simpler
vec2 box = step(vec2(0.4, 0.25), st)-step(vec2(0.6,0.75), st); vec2 box = step(vec2(0.4, 0.25), st)-step(vec2(0.6,0.75), st);
float r = sin(u_time/20.0); //trying to make an outline
float g = sin(u_time/30.0); vec2 smallerbox = step(vec2(0.401, 0.251), st)-step(vec2(0.599,0.749), st);
float b = sin(u_time);
//box = box * (vec2(1.0)-smallerbox);
//i don't understand these results, but when subtracting after the x and y are extracted it works (see next line)
float val = (box.x * box.y) - (smallerbox.x * smallerbox.y);
float r = (1.0+sin(u_time+20.0))/2.0;
float g = (1.0+sin(u_time+50.0))/2.0;
float b = (1.0+sin(u_time))/2.0;
//float mod = distance(stm, vec2(0.5)); //float mod = distance(stm, vec2(0.5));
float mod = 1.0; float mod = 1.0;
color.r = r*mod; color.r = r*mod;
color.g = g*mod; color.g = g*mod;
color.b = b*mod; color.b = b*mod;
color = color; color = color;
gl_FragColor = vec4(color, val);
gl_FragColor = vec4(color, box.x*box.y);
} }