Move your mouse around...Click to cycle through the number of octaves used.
A fork of procedural night reflections by Pierre MARZIN
xxxxxxxxxx
var gl,noctaves;
function setup() {
createCanvas(windowWidth, windowHeight,WEBGL);
gl=this.canvas.getContext('webgl');
gl.disable(gl.DEPTH_TEST);
noctaves=1;
test=new p5.Shader(this._renderer,vert,frag);//shaders are loaded
shader(test);//shaders are applied
}
function draw() {
test.setUniform("iResolution", [width,height]);//pass some values to the shader
test.setUniform("iTime", millis()*.001);
test.setUniform('iMouse',[mouseX,mouseY]);
test.setUniform("noctaves",noctaves);
shader(test);
box(width/2);
}
function mouseReleased(){
//noctaves=2+noctaves++%7;
}