-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
onBeforeRender,onAfterRender docs seem to imply they are not called on Scenes, but they are #26390
Comments
Also, it seems to be called differently from what the doc specifies: |
It's probably best to add an entry for Maybe we should consider to remove |
Oh no! I was hoping it would be made official so I could use it :-) My use case is that I want to set OTOH my use case isn't necessarily all that compelling, and perhaps doesn't justify the complication in the API, since I could just call my before-render function myself, explicitly, before each render, instead:
|
is anyone is working on it? |
This issue is primarily about updating docs. However, I would like to know how other collaborators feel about removing The example that originally required both callbacks has been removed and the callbacks are also not required for post processing in XR, see #26160. |
Considering the removal of onBeforeRender() and onAfterRender() callbacks from Scene objects, making them applicable only to actual renderable items. This approach aims to provide a more streamlined and consistent policy, reducing complexity while enhancing the efficiency of these callbacks. |
I believe they should be called at least for Groups, and maybe Scenes as well. The rationale for this is sometimes you may want to alter renderer state before the collection of renderable objects contained with that group/scene is rendered. For example, maybe you want to clear the depth buffer and set the render order for the group/items to be later, so this group will always be rendered on top. |
I find It is not critical, one could add a custom callbacks into the composer instead, but it is handy. If it is not removed, I think it should be documented, as it uses different parameters |
Description
The docs for onBeforeRender and onAfterRender (at https://threejs.org/docs/#api/en/core/Object3D, or dev branch) say this:
From that, I would guess that these two functions probably do not get called on Scenes, but that guess would be wrong.
This actual behavior is also mentioned by @Mugen87 in #19477 (comment)_ .
If this behavior is official and can be relied on, it would be good to state it in the docs.
Reproduction steps
doc issue
Code
doc issue
Live example
doc issue
Screenshots
No response
Version
dev branch
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: