-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
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?
- 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)
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
Reactions are currently unavailable