Most appropriate sub-area of p5.js?
p5.js version
2.2.2
Web browser and version
145.0.7632.117 (Official Build) (arm64)
Operating system
Mac OS 14.6.1 (23G93)
Steps to reproduce this
Steps:
- Visit https://editor.p5js.org/neill0/sketches/ZmBjlLngO
- Observe sketch fails with
ERROR: 0:313: 'assign' : l-value required (can't modify an input "myVar")
Snippet:
let myVar = sharedVec2();
// Adding objectInputs block crashes it
objectInputs.begin();
objectInputs.position += [0, 0, 0];
objectInputs.end();
pixelInputs.begin();
myVar = pixelInputs.texCoord;
pixelInputs.end();
finalColor.begin();
finalColor.set([myVar.r, myVar.g, 0, 1]);
finalColor.end();
Use case
- Displaced terrain vertices - needs
objectInputs
- The terrain is coloured in
finalColor based on, say, a texCoord that has to be saved from before finalColor, using a shared variable set in, say, pixelInputs.
Link to discord discussion