-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Remove UV warning when setting textures with setUniform() #5512
Comments
@aferriss can I work on this issue ? |
@Yash621 Of course, go right ahead! |
Can the admins suggest that if removing this line with close the issue. p5.js/src/webgl/p5.RendererGL.Immediate.js Lines 140 to 144 in 95b82ea
Or I can write a if statement that can check if setUniform has been called and then no warning is issured. |
Thanks @Gaurav-1306. What do you think, @aferriss and @davepagurek? |
I think that line is indeed the one causing the error! I think we still want it, so like you said, we'd add to the if statement condition so that it doesn't get logged in as many cases. I think we don't even need to check if p5.js/src/webgl/p5.RendererGL.js Lines 540 to 542 in 95b82ea
|
i came up with this implementation. do you think it is good to be merged? i basically added a else if statement with the new conditions. i tested it using the lib/empty-example. it was showing no error. |
I think that looks good! |
Most appropriate sub-area of p5.js?
Details about the bug:
If you are using the vertex function and supplying your own UV's, when using the
setUniform()
function to send a texture to a custom shader, a warning is triggered telling you: "You must first call texture() before using vertex() with image based u and v coordinates ".Since we're supplying the texture with
setUniform()
, we shouldn't be showing this warning.Actually, I think there is a case to be made to remove this warning entirely. It could be that the user is writing a procedural shader, and not using textures, in which case, the warning isn't necessary at all.
The warning seems to go away when using textureMode(NORMAL);
Here's a small example showing the issue
The text was updated successfully, but these errors were encountered: