xxxxxxxxxx
31
let s;
let video;
function preload(){
s = loadShader('s.vert', 's.frag');
}
function setup() {
createCanvas(window.innerWidth,window.innerHeight,WEBGL);
video = createCapture({
audio: false,
video: {
facingMode: "environment"
}
});
// video.start();
}
function draw() {
background(220);
s.setUniform("iChannel1", video);
s.setUniform("resolution", [width, height]);
s.setUniform("time", millis()*.001 );
shader(s);
rect(0,0,22,22);
}