xxxxxxxxxx
// https://www.udemy.com/course/learn-glsl-shaders-from-scratch
var mainShader;
function preload() {
mainShader = new p5.Shader(this.renderer, vShader, fShader);
}
function setup() {
createCanvas(min(windowWidth, windowHeight), min(windowWidth, windowHeight), WEBGL);
}
function draw() {
shader(mainShader);
mainShader.setUniform("uMousePos", [mouseX / width, mouseY / height]);
noStroke();
plane(width, height);
}
function windowResized() {
resizeCanvas(min(windowWidth, windowHeight), min(windowWidth, windowHeight));
}