-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
scene.drillPick does not work with Primitive batching #2442
Comments
Looks like it is supposed to work, but it requires that per-instance show is used and we need to swap the order of the We could probably just always include that in the shader, but we have bigger fish to fry at the moment. We could keep this Sandcastle example with primitives if needed. |
Looks like you're right. I was able to fix it with some minor tweaks so that it works as long as there's a |
Partially fixes #2442 (except in cases where there is no show attribute).
I assume we should keep this open since it still fails if the primitive does not have a show instance attribute. |
Yes |
This seems to cause an infinite loop if you are not using a ShowGeometryInstanceAttribute on the GeometryInstances and are just showing an entire Primitive using primitive.show. |
Good catch. We should just shut off the entire primitive if it doesn't have the show attribute. EDIT: Good, not Could |
As pointed out by @mantelpiece in #2442, if batched Primitives do not have a show attribute, we end up in an infinite loop because the primitive is never hid. This change fixes that problem as well as cleans up drillPick in general to be a little faster and easier to read. Also added tests for batched primitive picking, of which we had none.
I found that its possible for Scene.drillPick to get into an infinite loop. The sandcastle link below uses a KML feed that causes it to occur fairly consistently, but it seems like it can happen anytime there is feature data on the globe. If this is a different bug, i can create a new issue. The issue can be worked around by providing a limit to drillPick (the 2nd argument) as it will break from the while loop when it hits the limit. In debugging it seemed to always occur on a label or label collection and the color scratch it was looking for in PickFramebuffer.end() was:
Pause the time and set it to the max to display all of the features. Move your mouse around the globe, pan, zoom and eventually everything hangs because drillPick is in an infinite loop. |
CC #4784 |
I seem to have a similar problem to lloyda06. In my case, I was accidentally drillpicking outside of the Cesium canvas (not sure if that's relevant), and drillPick would go into an infinite loop in the same way that lloyda06 described. I was using a typical Cylinder entity and trying to select a point primitive in a point primitive collection underneath several cylinders. DrillPick selected the same cylinder entity over and over, not a label, though. Providing a limit to drillPick is not an acceptable solution in my case. If I specify a limit less than, say, 5, then it doesn't drill far enough to reach the desired entity. If I specify a limit greater than 5, the app starts to lag significantly. I was not able to reproduce the issue in SandCastle, unfortunately. |
scene.drillPick
currently works by picking, hiding the picked primitive, and then repeating the process until no primitives are picked. This means that when usingPrimitive
batching, only one geometry from each primitive gets picked, makingdillPick
basically useless.This has been a problem since it was first introducedin #978, but as far as I know, no one realized it until now.
The text was updated successfully, but these errors were encountered: