-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
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-rc2
Web browser and version
Chrome 143
Operating system
MacOS 15.2
Steps to reproduce this
Steps:
- Create a WebGPU canvas
- Create a shader that moves vertices using the instance id
- Create some custom geometry
- Draw the geometry using the shader + an instance count
Nothing renders in WebGPU mode, but it renders correctly if you switch back to WebGL.
Snippet:
Live: https://editor.p5js.org/davepagurek/sketches/FBR7lqDXS
let geom
let sh
async function setup() {
await createCanvas(400, 400, WEBGPU)
// This works
// createCanvas(400, 400, WEBGL)
geom = buildGeometry(() => sphere(10))
sh = baseMaterialShader().modify(() => {
getWorldInputs((inputs) => {
inputs.position.x += instanceID() * 30
return inputs
})
})
}
function draw() {
background(100)
push()
noStroke()
shader(sh)
model(geom, 5)
pop()
}