-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Implement picking functionality #4657
Conversation
c638593
to
1c6a2c6
Compare
reviewers: it's almost ready, missing only the java API I think and maybe a sample. |
Should we add picking to matc's |
1c6a2c6
to
c0c0bb1
Compare
android/filament-android/src/main/java/com/google/android/filament/View.java
Show resolved
Hide resolved
android/filament-android/src/main/java/com/google/android/filament/View.java
Outdated
Show resolved
Hide resolved
4e0b8b0
to
0a67956
Compare
0a67956
to
cbeb7e9
Compare
This is just a minimal change to get the R_INTEGER format to work. - if src/dst types are identical, just copy (this avoids a mul and a div) - add R,RG and INTEGER types
cbeb7e9
to
07be34d
Compare
This is a pixel accurate implementation of picking. Picking queries can be created on view, and upon completion a user provided callback is called with the Entity of the renderable at the queried coordinates in the viewport. Picking queries typically have 1 or 2 frame of latency and may impact performance on some drivers. It is mostly intended for use by editors, or when latency is not a major concern. This api should not be used for dragging/moving objects, it is intended for initial picking only. Picking is implemented in the structure pass. The depth buffer value is retrieved and the fragment coordinate is reconstructed and passed to PickingQueryResult. This can be used in turn to calculate the view and/or world space position.
07be34d
to
8024c6e
Compare
Thank you for providing this handy API for us and it can make our lives easier. I have one question for you: If one picking query is requested and multiple entity is selected, how would the PickingQueryResult return these multiple entities? |
It won't, it will return the closest Entity. |
How to support pick moving/dragging objects? |
Is there any way to get picked material or primitive? Or idea what should be done to make it possible? |
The pick result callback has returned nearest entity. You can use renderableManager.getMaterialInstance to get selected material . |
Thank you. |
This is a pixel accurate implementation of picking. Picking queries
can be created on view, and upon completion a user provided callback
is called with the Entity of the renderable at the queried coordinates
in the viewport.
Picking queries typically have 1 or 2 frame of latency and may impact
performance on some drivers.
It is mostly intended for use by editors, or when latency is not a major
concern. This api should not be used for dragging/moving objects, it is
intended for initial picking only.
Picking is implemented in the structure pass.