[p5.js 2.0 Bug Report]: build*Shader methods don't work yet in instance mode
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.1
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
To use .modify() in instance mode, you have to call it like this:
baseMaterialShader.modify(({ p5 }) => { p5.getWorldInputs((inputs) => { inputs.position.x += 5 return inputs }) }, { p5 })
Currently, the new build*Shader methods don't pass along the second context object:
| fn.buildFilterShader = function (callback) { | |
| return this.baseFilterShader().modify(callback); | |
| }; |
It needs to do so to be able to support that syntax, e.g.:
buildMaterialShader(({ p5 }) => { p5.getWorldInputs((inputs) => { inputs.position.x += 5 return inputs }) }, { p5 })