Skip to content
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

Add DepthPickingPass #288

Open
alouis-jpg opened this issue Jun 19, 2024 · 1 comment
Open

Add DepthPickingPass #288

alouis-jpg opened this issue Jun 19, 2024 · 1 comment

Comments

@alouis-jpg
Copy link

Thanks for this great library, it enhances so much 3d renderings on the web and brings many interestings layers of information to the models.
With the depth's visualization already available it would be very useful to have a DepthPickingPass component useable in the EffectComposer scope so as to read depth at a specific screen position.

Would love to this work in react-postprocessing!

@alouis-jpg
Copy link
Author

alouis-jpg commented Jun 21, 2024

Based on DepthPickingPass implementation in the react-postprocessing Autofocus component (see source code here), I was able to implement DepthPicking in my r3f project. Here is a sandbox demo.

However, having a drei PerspectiveCamera in my r3f scene seems to tamper with the use of the depth buffer and compromise react-postprocessing DepthOfField and Autofocus as well as DepthPicking. It is visible by uncommenting <PerspectiveCamera/> in the sandbox demo.
As I would like to use both drei's camera and postprocessing's effects, insights on why drei's camera does not work with DepthPickingPass are very much welcome!

Also, would it make sense to have a react-postprocessing DepthPickingPass component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant