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

Picking clipped entity breaks picking #8824

Open
bkuster opened this issue May 6, 2020 · 4 comments
Open

Picking clipped entity breaks picking #8824

bkuster opened this issue May 6, 2020 · 4 comments

Comments

@bkuster
Copy link
Contributor

bkuster commented May 6, 2020

Issue

When an entity is clipped and picked in the same animation frame, there is a null pointer in the pick render pass, due to a missing uniforms entry (in other words. The uniforms array has a length of n but only n - 1 entries).

Background

In our application we dynamically place clipping planes. Sometimes the screen space, where the clipping plane is applied is picked within the same animation frame. After this happens, picking is broken.

Reproduction

I made a Sandcastle to programatically recreate the error, see this gist.*

  1. Create a tileset entity
  2. Wait for the entity to be fully rendered
  3. Set the clipping planes and pick the screen space where the entity is visible
  4. See console for error

* this is a modified version of the ClippingPlane Sandcastle with only the entity. The magic happens on lines 43 to 47.

@OmarShehata
Copy link
Contributor

Thanks for the detailed steps to reproduce @bkuster ! I can see this triggers an error in your Sandcastle here.

However, when running it in Sandcastle locally, it doesn't produce an error, but correctly just returns that it picked undefined. Are you seeing this behavior too? You can run Sandcastle locally by cloning here, running npm install and npm run start and then going to http://localhost:8080/Apps/Sandcastle/index.html.

@bkuster
Copy link
Contributor Author

bkuster commented May 7, 2020

Thanks for the fast response @OmarShehata . I can also reproduce it in a local Sandcastle (on master). It took me quite some time to find the actual cause of the error and timing is everything. Maybe something loads faster/slower in your local Sandcastle and you would need to tweak the timeout settings or maybe even the picked screen positon.

@midnight-dev
Copy link

@bkuster I think you're right about timing being a factor. It could come down to hardware refresh rate or a browser's rAF. Did you notice this on a high refresh rate display or a standard 60Hz panel?

I'll check to see if browser agent matters when I get to my PC.

@PolanZ
Copy link

PolanZ commented Jun 30, 2023

@OmarShehata hi, i created a sample, please see Sandcastle Example

throw error when the mouse pick the 3dtiles.

Recently, I discovered that the texture on the clipping plane was missing during debugging. This occurred because it was executed during the "Cesium3DTileset.prototype.prePassesUpdate" phase, and it may not have been executed when picking.

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

No branches or pull requests

4 participants