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

Sample ray grid traversal #776

Merged
merged 23 commits into from
Nov 18, 2024
Merged

Sample ray grid traversal #776

merged 23 commits into from
Nov 18, 2024

Conversation

smlpt
Copy link
Contributor

@smlpt smlpt commented Sep 12, 2024

This PR adds another volume sampling function in addition to the existing sample ray function. The downside of sampling a volume at even intervals is that some voxels may be sampled twice, resulting in plateaus that can make it difficult to find local maxima.
This is why I implemented the grid traversal algorithm by Amanatides and Woo, which also takes an entry and an exit position, but it traverses the grid one voxel at a time instead of moving directly along the ray at even step sizes.

Because there are no evenly sized delta values to return here, this function returns two lists as a pair; one list that contains all sampled values, and one list with all corresponding voxel positions.

smlpt added 6 commits August 27, 2024 10:19

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@smlpt smlpt added the enhancement Issue or PR discusses an enhancement label Sep 12, 2024
# Conflicts:
#	src/main/kotlin/graphics/scenery/Camera.kt
…l ray sampling
…for better visibility
@smlpt smlpt added the bugfix PR contains a bugfix label Sep 19, 2024
@smlpt
Copy link
Contributor Author

smlpt commented Sep 19, 2024

This PR now also fixes several issues with RAI volume sampling and buffered volume sampling, especially with anisotropic volumes. It also fixes the bounding box generation for anisotropic volumes, which caused issues with the entry/exit points for the volume sampling.

@smlpt smlpt marked this pull request as ready for review September 20, 2024 12:44
…ide the bounding box
Copy link
Member

@kephale kephale left a comment

Choose a reason for hiding this comment

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

I read this over. It looks quite reasonable.

@smlpt
Copy link
Contributor Author

smlpt commented Oct 21, 2024

Thanks @kephale! It looks like I can't rebase it due to conflicts, but Github won't show me which ones. Shall we merge instead?

@smlpt
Copy link
Contributor Author

smlpt commented Nov 15, 2024

@kephale I think this PR will also fix scenerygraphics/sciview#605, once we publish a new scenery release.

@kephale
Copy link
Member

kephale commented Nov 16, 2024

@skalarproduktraum bump

Copy link
Member

@skalarproduktraum skalarproduktraum left a comment

Choose a reason for hiding this comment

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

Thanks @smlpt 👍

@skalarproduktraum skalarproduktraum merged commit 9ed488d into main Nov 18, 2024
3 of 6 checks passed
@skalarproduktraum skalarproduktraum deleted the sampleRayGridTraversal branch November 18, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR contains a bugfix enhancement Issue or PR discusses an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants