-
-
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
Object3D: Add onBeforeShadow and onAfterShadow callbacks #25933
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Oh, didn't check the existing PRs, my bad. |
I see you keep the signature similar to At first glance, the change looks good to me! |
The names of the callback could maybe more compact. Meaning |
@sunag Just to clarify: Do you think these callbacks would also be useful in context of @RenaudRohlinger We should clarify this because ideally new callbacks on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed both methods to onBeforeShadow
and onAfterShadow
I think it makes sense for |
In this case I suggest to stall this PR a bit until we a more confident on the WebGPU side. |
Fixed #14921.
This PR introduces two new optional callbacks to the Object3D class in three.js. The onBeforeShadow and onAfterShadow callbacks allow developers to execute custom code immediately before and after the shadow of a 3D object is rendered, respectively. These callbacks provide the following parameters: renderer, scene, camera, shadowCamera, geometry, depthMaterial, and group.
Example usage:
These new callbacks offer developers more control and flexibility when working with shadows in their projects.