-
-
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
Renderer: .setRenderObjectFunction()
#27068
Conversation
|
.setRenderObject()
.setRenderObjectFunction()
|
||
renderer.setRenderObjectFunction( ( object, ...params ) => { | ||
|
||
if ( object.castShadow === true ) { |
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.
Maybe it would be simpler to do something like... renderer.setRenderObjectFilter( object => object.castShadow === true )
? /ping @sunag
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.
I think setRenderObjectFunction
is more handler-oriented than filter-oriented. If there were any changes I would suggest setRenderObjectHandler
.
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.
Yeah, I certainly agree "handler" would be a better name -- but I just think maybe it would be better for a user-facing API to be simpler and don't provide full "handling" behavior, but only the "filtering" one.
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.
We have more applications this way, for example, such as adding onBeforeShadow
and onAfterShadow
soon.
Related issue: #25822, #27053, #25933
Description
renderer.renderObjectFunction()
offers the ability to filter or change the object in the rendering state, this fixes the current optimization problem in shadow rendering inWebGPURenderer
and can also be used in cases like this #25933 and others where users usescene.traverse()
to make the filter of objects could use this method which already pass through thefrustumCulled
filter.Usage