p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Support strands shader variable names including double underscores

Open eupthere opened this issue 5 months ago • 0 comments

Resolves #8875 Resolves #8794

Changes:

  • Explicitly initialize strandsContext and add JSDoc comments for fields overview.
  • Support strands variable name including double underscores for uniform / varying / shared.
  • Introduce internal strands variable namespace _p5_strands_*.
  • Store shaderNameMap, shaderNameState in strandsContext and shader hooks.
  • Restore internal shader names like _p5_strands_0 back to the original user-facing names like __val in WebGL shader compile errors, to make debugging easier.
  • Add unit test for changed code

Tests Passed:

  • npm test -- test/unit/webgl/p5.Shader.js
  • npm test -- test/unit/webgpu/p5.Shader.js

PR Checklist

  • [ ] npm run lint passes
  • [x] Inline reference is included / updated
  • [x] Unit tests are included / updated

eupthere avatar Jun 16 '26 15:06 eupthere