-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Node: onBefore, onAfter events #30212
Comments
Are you aware of the existing possibilities to implement such use cases? The idea is to derive from the built-in node classes and then implement the already existing update methods. three.js/src/nodes/core/Node.js Lines 532 to 558 in eb8c334
To let the methods executed per render, you must set |
Hey @Mugen87 Thanks for the answer, I was not aware of this mechanism, as it isn't mentioned in the wiki, and not once in the examples ! I'll look at it, many thanks |
If you need more examples for this pattern, check out the post processing modules in examples/jsm/tsl/display. They use these methods all over the place. |
Thanks @Mugen87 |
Description
Callbacks before a node is rendered, and after a node is rendered would be extremely useful to set renderer state such as autoClear etc.. but also helping for custom instructions
For example
a reflector, or water, if we need to setup a camera layer before those actually renders for selective render inside a reflector
this requires a callback before and after the node actually renders
An issue I mentionned here :
#30197
Solution
Provide a onBeforeNode, and onAfterNode render
The text was updated successfully, but these errors were encountered: