xxxxxxxxxx
let theShader;
let canvas;
function preload(){
theShader = loadShader('vert.glsl', 'frag.glsl');
}
function setup() {
pixelDensity(2);
canvas = createCanvas(1000,1000, WEBGL);
background(0);
noStroke();
shader(theShader);
}
function draw() {
theShader.setUniform("u_resolution", [width*2, height*2]);
theShader.setUniform("u_time", millis() / 1000.0);
theShader.setUniform("u_mouse", [mouseX, map(mouseY, 0, height, height, 0)]);
rect(width * -0.5, height * -0.5, width, height);
}