-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 Scene._pickVoxelCoordinate to report voxel tile and sample numbers #11784
Conversation
Thanks for the PR @jjhembd! Before we get into the implementation details, I wanted to check on the API. In your example, it looks like you are making two pick calls: One general Is the first call strictly necessary? Is is OK to call |
const voxelPrimitive = scene.pick(mousePosition);
const voxelCoordinate = scene.pickVoxel(mousePosition);
const voxelData = voxelPrimitive.getData(voxelCoordinate); // This method not implemented yet We could potentially combine all 3 calls into one |
I think that would be simplest from a public API perspective. |
I moved the coordinate picking method to a private method. We can clean up the public API in a subsequent PR. Remaining tasks for this PR:
|
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.
Overall this is looking good to me @jjhembd!
Everything is working well on the procedural dataset. Looking forward to see how its working with any collected data.
@jjhembd Updates are looking good to me! Anything else in this PR before merging? |
@ggetz I think this one is ready to go. The remaining changes will go in the 3rd PR. |
@jjhembd it looks like frameState.passes.pick = true;
frameState.passes.pickVoxel = true; That way the code can leverage the existing picking infrastructure and only check for @javagl and I were discussing this in the context of #12075 for a new flag |
Description
This is another incremental step towards Voxel Picking.
A new pass type
FrameState.Passes.pickVoxel
renders an ID for the picked voxel tile and an index of the picked sample within the tile. This pass is triggered, and the rendered ID reported, by the newScene.pickVoxel
.Example usage:
Testing plan
See this testing Sandcastle to report tile and sample indices for random procedural voxels.
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change