Fix WebGPU bugs surfaced by the Intro to Strands tutorial by davepagurek · Pull Request #8538 · processing/p5.js

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@davepagurek

Copy link

Contributor

Changes:

  • In WGSL, you can't put an int in a vector constructor and have it auto-convert to float. I've updated p5.strands to auto cast int args into floats in vector constructors.
  • There was a bug where textures in strands uniforms weren't getting added to the p5 shader, because they don't get packed into uniform structs like numeric uniforms. That's fixed now.
  • I noticed a bunch of uses of something instanceof StrandsNode rather than something.isStrandsNode, the latter being more robust against shared code in the WebGL/WebGPU built files where we might accidentally end up with two separate StrandsNode classes at runtime. I've updated those.
  • I Luke's sketch to the webgl and webgpu visual tests

Screenshots of the change:
image

https://editor.p5js.org/davepagurek/sketches/Cq_g72a9L

PR Checklist

ksen0 reacted with heart emoji

@davepagurek davepagurek merged commit 1ca3781 into dev-2.0

Feb 18, 2026

5 checks passed

@davepagurek davepagurek deleted the fix/tutorial-webgpu branch

February 18, 2026 02:18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@davepagurek