processing/p5.js
View on GitHub[p5.js 2.0+ Bug Report]: p5.strands breaks if uniforms have two underscores in them
Open
#8794 opened on May 13, 2026
Area:WebGLArea:WebGPUHelp Wantedp5.js 2.0+p5.strands
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.x
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
- Create a p5.strands shader
- Create a uniform containing two underscores
- Use it in the shader
We currently try to make uniform variables in the shader code named the same as the variable in your javascript. However, GLSL doesn't let you have two underscores:
Yikes! An error occurred compiling the vertex shader: ERROR: 0:47: '__val' : identifiers containing two consecutive underscores (__) are reserved as possible future keywords
We would need to rename these internally to not have this issue.
Snippet:
function setup() {
createCanvas(400, 400, WEBGL);
const myShader = buildFilterShader(() => {
const __val = uniformFloat(() => 0.5)
filterColor.begin()
filterColor.set([__val, __val, __val, 1])
filterColor.end()
})
filter(myShader)
}
Live: https://editor.p5js.org/davepagurek/sketches/lQtNOhb66