xxxxxxxxxx
var toon;
var def;
var shaderEnabled = true;
function setup() {
pixelDensity(1);
createCanvas(windowWidth, windowHeight, WEBGL);
noStroke();
fill(204);
toon = new p5.Shader(this._renderer,toonVert,toonFrag);
}
function draw() {
//toon.uniforms.uUseLighting = true; // required for p5js?
this.shader(toon);
background(0);
var dirY = (mouseY / float(height) - 0.5) * 4;
var dirX = (mouseX / float(width) - 0.5) * 4;
toon.setUniform('iMouse', [mouseX, mouseY]);
toon.setUniform('iResolution', [width, height]);
toon.setUniform('iTime', millis()/1000);
rect(-width/2, -height/2, width, height);
}