-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Pick transparent renderables #6633
base: main
Are you sure you want to change the base?
Pick transparent renderables #6633
Conversation
& (mi->isDepthWriteEnabled() | (mode == TransparencyMode::TWO_PASSES_ONE_SIDE)) | ||
& (mi->isDepthWriteEnabled() | ||
|| (mode == TransparencyMode::TWO_PASSES_ONE_SIDE) | ||
|| Variant::isPickingVariant(variant)) |
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.
Should I add a boolean material property to support excluding a material from picking?
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.
@pixelflinger can explain this in more detail but this function is in the deep inner loop of Filament and written to be branchless. You should be using long circuit operators instead of short circuit. I'm also not sure if we want to test for picking here.
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.
You should be using long circuit operators instead of short circuit.
Then I can cast the boolean value to an integer to avoid the compilation error.
I'm also not sure if we want to test for picking here.
It is required to render the transparent objects in the picking pass.
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.
How are transparents handled with this change? Do they take precedence over opaques behind them?
I believe that the whole scene is rendered to the picking buffer based on the fragment depth. Yes, a renderable is picked if it is the closest to the camera. |
Thanks for the PR I need to maul over it for a while. My areas of concerns:
Maybe a picking pass is the right way to do it, this would allow to control what goes into that pass. Maybe we need a way to select the resolution, because 1/4 res picking might still be useful at 1/4 the price. Lots of things to think about... |
Yes, I think it would be great to use a boolean material property for that. |
Hi @pixelflinger! |
We're very sorry for the delay, we've been, and still are, very busy. This will take a bit longer. |
@grassydragon @pixelflinger How is going about this pr. I also met the same problem which transparent cannot be picking in |
I guess that everyone at Google is now preparing for I/O. |
With I/O behind us, any chance the team could take another look at this? We have a need for picking transparent renderables, so it'd be great to have a solution for this. Would supporting customization of the picking pass (ability to exclude transparents and specify resolution) be sufficient to get this approved? Or is the current approach sufficient for now? Thanks. |
Hi @pixelflinger! |
@grassydragon sorry for the long time getting back to this PR. This is what I would like to see:
|
Closes #6614