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

Voxel picking #11828

Merged
merged 41 commits into from
Feb 19, 2024
Merged

Voxel picking #11828

merged 41 commits into from
Feb 19, 2024

Conversation

jjhembd
Copy link
Contributor

@jjhembd jjhembd commented Feb 13, 2024

Description

This PR implements picking of individual cells from a VoxelPrimitive.

The new method Scene.pickVoxel returns an instance of the new class VoxelCell. The VoxelCell instance exposes getters that report information about the voxel rendered at the cursor position.

See the previous staging PRs:

Issue number and link

Testing plan

  1. Make sure specs run through locally (some use a no-op matcher on CI)
  2. Load this local Sandcastle and verify that mouseover picking works and is performant.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have update the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Jeshurun Hembd and others added 30 commits January 1, 2024 20:00
Keep voxel data in memory for picking
Add Scene._pickVoxelCoordinate to report voxel tile and sample numbers
@jjhembd jjhembd marked this pull request as ready for review February 14, 2024 21:21
@jjhembd
Copy link
Contributor Author

jjhembd commented Feb 14, 2024

Many of the properties of the FragmentInput struct for a voxel CustomShader are undocumented, including two new properties tileIndex and sampleIndex added in this PR.

However, rather than documenting them separately, I think it would be a similar level of effort to rework the struct to be consistent with the already-documented FragmentInput struct used for Cesium3DTileset and Model.

Either way, I think it may be out of scope for this PR. I opened #11832 to discuss further.

@jjhembd
Copy link
Contributor Author

jjhembd commented Feb 15, 2024

I added a local Sandcastle for testing. This should be ready for final review.

image

@@ -4145,6 +4151,57 @@ Scene.prototype.pick = function (windowPosition, width, height) {
return this._picking.pick(this, windowPosition, width, height);
};

/**
* Returns a VoxelCell for the voxel sample rendered at a particular window coordinate,
Copy link
Contributor

@ggetz ggetz Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this, as well as the VoxelCell class, should be marked as "experimental" like the other voxel classes.

@@ -4145,6 +4151,57 @@ Scene.prototype.pick = function (windowPosition, width, height) {
return this._picking.pick(this, windowPosition, width, height);
};

/**
* Returns a VoxelCell for the voxel sample rendered at a particular window coordinate,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns a VoxelCell for the voxel sample rendered at a particular window coordinate,
* Returns a {@link VoxelCell} for the voxel sample rendered at a particular window coordinate,

@ggetz
Copy link
Contributor

ggetz commented Feb 16, 2024

@jjhembd Should the Sandcastle example you have in your comment be added as a developer Sandcastle?

@ggetz
Copy link
Contributor

ggetz commented Feb 16, 2024

@jjhembd I'm seeing some flickering when picking. Any idea what may be causing it?

2024-02-16.09-34-15.mp4

@jjhembd
Copy link
Contributor Author

jjhembd commented Feb 19, 2024

Thanks for the feedback @ggetz. I addressed everything except the flickering.
I agree the flickering looks wrong. Unfortunately I'm not able to reproduce it on my machine. Perhaps we should leave that as a separate issue?

@ggetz
Copy link
Contributor

ggetz commented Feb 19, 2024

@jjhembd Sure, OK to open as a separate issue, though sometime soon we'll need to understand how often it arises in order to prioritize.

@jjhembd
Copy link
Contributor Author

jjhembd commented Feb 19, 2024

See #11841 for the flickering issue

@ggetz
Copy link
Contributor

ggetz commented Feb 19, 2024

Thanks @jjhembd!

@ggetz ggetz merged commit 1f9116e into main Feb 19, 2024
9 checks passed
@ggetz ggetz deleted the voxel-picking branch February 19, 2024 18:05
@jjhembd jjhembd mentioned this pull request Mar 29, 2024
6 tasks
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

Successfully merging this pull request may close these issues.

None yet

2 participants