-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.2 RC
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
- Create a p5.strands shader
- Create a branch or a loop
- Assign to a property of inputs in it
The shader won't compile.
Snippet:
let material
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
material = baseMaterialShader().modify(() => {
getPixelInputs((inputs) => {
if (inputs.texCoord.x > 0.5) {
inputs.color = [1, 0, 0, 1]
} else {
inputs.color = [0, 0, 1, 1]
}
return inputs
})
})
}
function draw() {
background(255)
noStroke()
shader(material)
sphere(100)
}