rtx: volume space-skipping, field sampler unification, and custom-field fixes#310
Open
tarcila wants to merge 4 commits into
Open
rtx: volume space-skipping, field sampler unification, and custom-field fixes#310tarcila wants to merge 4 commits into
tarcila wants to merge 4 commits into
Conversation
Raise the ray-march early-out threshold to 0.999 and, once a segment is treated as opaque, zero its residual transmittance (opacity -> 1.0). Front-to-back compositing otherwise leaves a ~0.1% leak that is invisible against an LDR background but visibly over-transparent against an HDR one (bright sky, sun).
Return-by-value sampleValue/sampleNormal across all field samplers (Nvdb, Structured, Custom) and reclaim unused SBT sampler slots. The custom sampler also derives volume normals via central differences.
Build and upload a per-macrocell value-range grid for custom spatial fields in CustomField::finalize
via a single-pass interval kernel.
Handles signed/full-range values through a conservative {lo,hi} dispatch (VISRTX_CUSTOM_VALUE_RANGE_DISPATCH),
with a point-supersample fallback when no hook is provided.
- Provide VISRTX_CUSTOM_VALUE_RANGE_DISPATCH + ValueRangeWeightedPoints.cuh (conservative per-AABB {0, hi} interval) to match the engine's interval-based custom-majorant API; CMake wires the dispatch headers into the core library so it builds per-cell majorants for space skipping.
- Fix animation: free the prior values/indices arrays each frame (leak), track the perturbed bounds so the field domain follows the motion (blanking), re-fit the TF range at fixed sigma, and scale amplitude by the median nearest-neighbor distance.
- Tear down the previous field/volume/arrays on Regenerate/source change before rebuilding; otherwise the stranded objects' stale parameter handles later decrement reused pool slots (Object::decUseCount zero-use-count warnings).
- Refresh README.
The demo stays non-negative; signed/full-range value handling lives in the engine, not this demo.
Collaborator
Author
|
@favreau FYI. I've cleaned up a bit our volume management. Doing so, I've been updating the CustomFields demo to match that latest version. Can you review the demo when you have time and confirm this works OK? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opaque lattice fix: raise the ray-march early-out threshold to 0.999 and zero
residual transmittance once a segment is opaque. Fixes a ~0.1% HDR background
transparency leak invisible on LDR but visible against bright sky/sun.
Field sampler unification: return-by-value
sampleValue/sampleNormalacrossNvdb, Structured, and Custom samplers; reclaim unused SBT slots. Custom sampler
gains central-difference normals.
Custom-field space-skipping:
CustomField::finalizebuilds a per-macrocell{lo,hi}value-range grid via a single-pass interval kernel dispatched throughVISRTX_CUSTOM_VALUE_RANGE_DISPATCH. Falls back to point-supersampling when nohook is provided.
customField demo: implement
VISRTX_CUSTOM_VALUE_RANGE_DISPATCHalong with misc fixes.