-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit Scope of Default Uniforms #5279
Comments
Hi! And apologies for letting so many of your issues and PRs sit for so long. There are only a few WebGL maintainers on this repo at the moment so our availability can be spotty. I am not sure that the default uniforms should not be modified in custom shaders. I can imagine a case in which someone wants to distribute custom shaders for p5.js for people that don't know GLSL wherein the default uniforms with the p5 functions like I am not committed to this stance as I am not sure if this case or the case in which there is an accidental uniform naming collision is more likely. |
Hi, no worries, understandable! I'm very grateful for all the work you and fellow maintainers do =)! I see, that is a cool use case. Reminds me of the shader mods people make to games like Minecraft. In that case, I can try my best to document what each of the default uniforms do. --- What do you think of the last two commits, where the declaration of |
How would this new feature help increase access to p5.js?
Makes writing custom shaders more transparent.
Currently there are a couple of uniform names that are used by the default shaders. If a user uses these names in their program, the uniform values they set will get overwritten with the default values (and their program won't behave as they expect it to).
Most appropriate sub-area of p5.js?
Feature enhancement details:
The default shaders declare and use some uniforms. These reserved names are not known to a user. Rather than telling the user not to use this seemingly arbitrary list of reserved names, a better solution is to just not set these default uniforms when a user-defined shader is used (via
shader()
).More discussion on this can be found on the related issue on the p5.js-website repo.
The text was updated successfully, but these errors were encountered: