-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
[BUG]: onBeforeCompile hashing #13192
Comments
I looked into fixing this, but i'm not sure what to do. There is no way of knowing what's in the |
I've looked into this today and i wouldn't say it's a bug. More a feature request. The implementation of Workaround: It's easy to avoid the problem if you apply for each material a unique callback function. |
True, but it’s suuuuuuupeer hacky. I use this feature a lot and it’s very cumbersome to work with. Is there any chance you could take a look at my PR and give some feedback? With a couple more lines of code I think that this can become much more powerful and user friendly. As is:
|
I’d argue the semantics here :) It was not designed to begin with, I think it was literally “hey this works with 3 lines of code” 🤣 If I do however make a feature request do you think that this can be redesigned to be more friendly? |
Making a feature request is a good idea. You should note your requirements/suggestions in short/summarised form. Besides, link to your PR that illustrates your idea of a concrete implementation. I guess i would close this issue and create a new one with the mentioned content. |
I'm having a hard time to figure out an approach that is not a hack to implement this over the current material system. The #11475 hack was included instead. As I proposed in a previous meetup, I think we should study how to implement this on top of MeshNodeMaterial instead. |
This might be a solution for this feature:
|
Description of the problem
Go to https://codepen.io/anon/pen/KQPBjd. Comment line
#41
and the other cube that stays in the scene will change the shader.This is due to:
three.js/src/renderers/webgl/WebGLPrograms.js
Line 244 in 35a26f1
The same
onBeforeCompile
is provided to both materials, even though there is a condition that will process the shaders differently.#13198 has a different approach but doesn't have this issue:
https://codepen.io/anon/pen/rJNgYZ
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: