-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build Process
- Unit Testing
- Internalization
- Friendly Errors
- Other (specify if possible)
p5.js version
v1.4.1
Web browser and version
105.0.5195.127
Operating System
Windows
Steps to reproduce this
Steps:
- load the shader on the setup and use a callback to know when it's done
- console log a message on the setup()
- run the sketch and see its not stop running the setup()
Snippet:
let theShader;
let loaded = false;
function setup() {
pixelDensity(1);
createCanvas(windowWidth, windowHeight, WEBGL);
theShader = loadShader('shader.vert', 'shader.frag',
() => loaded = true
);
noStroke();
console.log("DONE SET UP")
}
function draw() {
if (!loaded) {
background(20);
fill(200)
circle(width/2, height/2, 200);
} else {
theShader.setUniform('u_resolution', [width, height]);
shader(theShader);
rect(0, 0, width, height);
}
}