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

add next hit HDDA to PNanoVDB #1600

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

gaida-exe
Copy link
Contributor

Signed-off-by: Sebastian Gaida [email protected]

@gaida-exe gaida-exe requested a review from kmuseth as a code owner March 13, 2023 18:49
@gaida-exe
Copy link
Contributor Author

This PR adds a new variant of the HDDA algorithm to PNanoVDB.
Before, there was only a zero crossing function, and this would add a variant that gets the next hit above 0.
Reason: The background value is often 0 and therefore the other HDDA zero crossing would never report a hit, because it checks for a sign change from start of the ray to tested voxel.

@gaida-exe
Copy link
Contributor Author

Hello @kmuseth I checked NanoVDB and if there is a function that matches the current proposed function and there is.
The TreeMatcher, like the proposed function, also marches with the HDDA to find the first active value and return true as well as the coordinates ijk. The difference is that the PNanoVDB function only returns if the value is greater than a given minimal value.
This is essentially the same check that you are doing in NanoVDB for the Generic Grids(this is a link)
In PNanoVDB we can't check for nullptr, but we can check for a value greater than 0 and also add the functionality to check for a value greater than the desired (link).

PNANOVDB_IN(pnanovdb_vec3_t) direction, float tmax,
PNANOVDB_INOUT(float) thit,
PNANOVDB_INOUT(float) valueAtHit,
PNANOVDB_INOUT(float) minimalValue
Copy link
Contributor

Choose a reason for hiding this comment

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

That probably only needs to be PNANOVDB_IN(float) minimalValue

Copy link
Contributor

Choose a reason for hiding this comment

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

@gaida-exe I have two issues with the current version of the HDDA:

  • It is is different from the one in NanoVDB.h which is problematic because it obviously means that their behaviors and APIs are now out of sync
  • I don't fundamentally understand why a tolerance is desirable. The background value for fog volumes should always be exactly zero

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello Ken, I agree with you and I removed the minimalValue. I also renamed the function to be the same of NanoVDB.

@danrbailey
Copy link
Contributor

Hi @gaida-exe, can you push an empty commit to this MR to trigger the CI to run again? Seems like it got stuck on one of the builds so we cannot merge in it's current state, thanks.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 24, 2023

CLA Missing ID CLA Not Signed

@linux-foundation-easycla
Copy link

CLA Missing ID CLA Not Signed

Signed-off-by: Sebastian Gaida <[email protected]>
@gaida-exe
Copy link
Contributor Author

Sorry for the CLA noise.

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.

3 participants