I want to thank you for trying to help me here. I am sorry but I simply do a copy from the p5js Web editor of my fragment shader, I paste it here and somehow, we end up with greyed areas and the a scrolly bar and I have no idea how to control whatever autoformat is taking over.
#ifdef GL_ES
precision highp float;
#endif
uniform float pixel_density;
uniform vec2 res;
uniform sampler2D buffer;
uniform float time;
uniform vec2 mouse;
void main() {
// this is a fork (or port) of GLSL Sandbox. I did not see that its author gave any real name or internet persona or anything.
// gl_FragCoord.xy
float positionX = (gl_FragCoord.x / res.x);
float positionY = 1.0 - (gl_FragCoord.y/ res.y);
// vec2 buffer_tc = st / (res * pixel_density);
// buffer_tc.y = 1. + buffer_tc.y * -1.;
vec2 position = vec2(positionX, positionY);
vec2 pixel = 1./res;
vec4 me = vec4 ( 1.0);
me = texture2D(buffer, position);
vec4 source;
vec2 wilbur;
vec2 rnd = vec2(mod(fract(sin(dot(position + time * 0.001, vec2(14.9898,78.233))) * 43758.5453), 1.0), mod(fract(sin(dot(position + time * 0.001, vec2(24.9898,44.233))) * 27458.5453), 1.0));
vec2 nudge = vec2(12.0 + 10.0 * cos(time * 0.03775), 12.0 + 10.0 * cos(time * 0.02246));
vec2 rate = -0.005 + 0.02 * (0.5 + 0.5 * cos(nudge * (position.yx - 0.5) + 0.5 + time * vec2(0.137, 0.262)));
float mradius = 0.02;// initially 0.007
if (length(position-mouse) < mradius) {
me.r = 0.5 + 0.5*sin(time * 1.234542);
me.g = 0.5 + 0.5*sin(3.0 + time * 1.64242);
me.b = 0.5 + 0.5*sin(4.0 + time * 1.444242);
me.a = 1.0;
} else {
rate *= 6.0 * abs(vec2(0.5, 0.5) - mouse);
rate += 0.5 * rate.yx;
vec2 mult = 1.0 - rate;
vec2 jitter = vec2(1.1 / res.x,
1.1 / res.y);
vec2 offset = (rate * mouse) - (jitter * 0.5);
// wilbur = position * mult + offset + jitter * rnd;
source = texture2D(buffer, position * mult + offset + jitter * rnd);
source *= vec4( 1.0001, 1.0001, 1.0001, 1.02);;
me = me * 0.05 + source * 0.95;
}
// This is where the original p5js backbuffer sketch starts
vec2 st = gl_FragCoord.xy;
vec3 col = vec3(1.0);
vec2 tc = st / (res * pixel_density);
vec2 buffer_tc = st / (res * pixel_density);
buffer_tc.y = 1. + buffer_tc.y * -1.;
// texture2D
vec3 buffer_samp = texture2D(buffer, buffer_tc).xyz;
buffer_samp = vec3(1.0) - buffer_samp;
float r = 0.03; // Initially 0.20
float ell = smoothstep(r,r-0.01,length((tc-mouse) * res / res.y));
col = vec3(1.0 - ell) - buffer_samp.xyz * 0.98;
if (col.x > 0.93) {col = vec3 (1.0);}
gl_FragColor = vec4(col,1.0); // For the original p5js backbuffer sketch
vec4 localColor = vec4(me.r, me.g, me.b, 1.0);
// gl_FragColor = (localColor);
// gl_FragColor = vec4((wilbur), 0.0, 0.8);
}