This commit is contained in:
2024-04-25 15:55:22 +02:00
parent 3cc008621f
commit fc8d0b349a

View File

@@ -3,12 +3,27 @@ precision mediump float;
#endif
uniform float u_time;
uniform vec2 u_resolution;
uniform vec2 u_mouse;
vec4 col() {
vec2 st = gl_FragCoord.xy/u_resolution;
vec2 mt = u_mouse/u_resolution;
// vec2 distanceVector = st-mt;
// float dist = sqrt(dot(distanceVector,distanceVector))
//this does the same as the previous commented code (i should've payed more attention to math)
float mod = 1.5-distance(st, mt);
float r = abs(sin(u_time));
float g = abs(cos(u_time/2.0));
float b = abs(tan(u_time/3.0));
return vec4(r, g, b, 1.0);
return vec4(r*mod, g*mod, b*mod, 1.0);
}
void main() {