Increasing access
Newcomers to shaders would be able to make simple unlit material shaders sooner, with only finalColor (and, say, noise() on texCoord).
In contrast, currently, I think they need to understand how to use shared variables to propagate the texCoord from pixelInputs, and need to know that it even exists there.
Most appropriate sub-area of p5.js?
Feature enhancement details
Instead of this for a material shader:
before
let coord = sharedVec2()
pixelInputs.begin();
coord = pixelInputs.texCoord;
pixelInputs.end();
finalColor.begin();
let coord = finalColor.texCoord;
finalColor.set(noise(coord.x, coord.y));
finalColor.end();
...we could instead write this:
after
finalColor.begin();
let coord = finalColor.texCoord;
finalColor.set(noise(coord.x, coord.y));
finalColor.end();
This assumes there is no situation where it texCoord for finalColor would be meaningless or ambiguous - I don't know.
Conversation in discord:
https://discord.com/channels/836700474425475088/1384610702467272785/1485021371607154749
Increasing access
Newcomers to shaders would be able to make simple unlit material shaders sooner, with only finalColor (and, say, noise() on
texCoord).In contrast, currently, I think they need to understand how to use shared variables to propagate the
texCoordfrom pixelInputs, and need to know that it even exists there.Most appropriate sub-area of p5.js?
Feature enhancement details
Instead of this for a material shader:
before
...we could instead write this:
after
This assumes there is no situation where it texCoord for finalColor would be meaningless or ambiguous - I don't know.
Conversation in discord:
https://discord.com/channels/836700474425475088/1384610702467272785/1485021371607154749