-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Support user defined uniform data in custom shaders.
https://p5js.org/reference/p5.Shader/setUniform/
In p5, setting uniform data is typically a necessity, as p5 doesn't provide any instance data such as width, height, mouseX, etc.
q5 does provide uniform data about the q5 instance by default though. So in q5, shader.setUniform would just be for custom data that users want to feed into the shader each frame. Pretty advanced stuff.
If q5 were to support this, I think the assumption would be the user's data is just f32 floats. q5 would make a struct for the data behind the scenes. It'd be put in a buffer each frame just like q5's default uniform data.
In q5, it'd be nice for users to be able to set uniform data in a JS object when they apply a shader, instead of having to use setUniform multiple times.
shader(myCustomShader, {
myUniform0: 1000,
myUniform1: 2000
});Metadata
Metadata
Assignees
Labels
Type
Projects
Status