-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
# Conflicts: # src/main/kotlin/graphics/scenery/Camera.kt
…rsection
…rsal
…tropy now
…l ray sampling
…t issue
…for better visibility
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. |
…rrors
…ide the bounding box
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.
I read this over. It looks quite reasonable.
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? |
@kephale I think this PR will also fix scenerygraphics/sciview#605, once we publish a new scenery release. |
@skalarproduktraum bump |
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.
Thanks @smlpt 👍
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.