Skip to content

rtx: volume space-skipping, field sampler unification, and custom-field fixes#310

Open
tarcila wants to merge 4 commits into
NVIDIA:next_releasefrom
tarcila:volume-fixes
Open

rtx: volume space-skipping, field sampler unification, and custom-field fixes#310
tarcila wants to merge 4 commits into
NVIDIA:next_releasefrom
tarcila:volume-fixes

Conversation

@tarcila

@tarcila tarcila commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator
  • 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/sampleNormal across
    Nvdb, Structured, and Custom samplers; reclaim unused SBT slots. Custom sampler
    gains central-difference normals.

  • Custom-field space-skipping: CustomField::finalize builds a per-macrocell
    {lo,hi} value-range grid via a single-pass interval kernel dispatched through
    VISRTX_CUSTOM_VALUE_RANGE_DISPATCH. Falls back to point-supersampling when no
    hook is provided.

  • customField demo: implement VISRTX_CUSTOM_VALUE_RANGE_DISPATCH along with misc fixes.

tarcila added 4 commits June 11, 2026 10:15
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.
@tarcila tarcila requested review from favreau and jeffamstutz June 11, 2026 15:39
@tarcila

tarcila commented Jun 11, 2026

Copy link
Copy Markdown
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?

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.

1 participant