-
Notifications
You must be signed in to change notification settings - Fork 40
Improve volume sampling and fix rendering issues #218
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
Conversation
tarcila
commented
Feb 9, 2026
- Nearest neighbour interpolation for NanoVDB volumes
- Volume gradient/normal computation across all spatial field types for shading support
- MDL fix for texture resource null-pointer dereference and uninitialized memory access
- Infinite accumulation when unitDistance is 0 in transfer function volumes
- Unused maxRayDepth from default/directLight renderer JSON
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.
Pull request overview
Improves volume rendering correctness and shading by adding gradient/normal support to spatial field sampling, introducing NanoVDB nearest-neighbor filtering, and fixing a few robustness issues (MDL sampler lifetime, unitDistance edge cases, renderer JSON cleanup).
Changes:
- Add optional gradient output to volume samplers and use it to compute world-space volume normals for the normal AOV.
- Add NanoVDB nearest/linear filtering selection and plumb it through GPU data + PTX samplers.
- Fix null/uninitialized MDL sampler handling; avoid division-by-zero/infinite accumulation for
unitDistance.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| devices/rtx/libmdl/types.h | Initialize TextureDescriptor::knownIndex to avoid uninitialized reads. |
| devices/rtx/device/volume/TransferFunction1D.cpp | Clamp oneOverUnitDistance defensively; add warning for invalid unitDistance. |
| devices/rtx/device/visrtx_device.json | Remove unused maxRayDepth renderer parameter from schema. |
| devices/rtx/device/spatial_field/StructuredRegularSampler_ptx.cu | Add optional gradient computation via central differences. |
| devices/rtx/device/spatial_field/StructuredRectilinearSampler_ptx.cu | Refactor sampling helper and add gradient computation. |
| devices/rtx/device/spatial_field/NvdbRegularSampler_ptx.cu | Add nearest/linear sampling and optional gradients; adjust index mapping. |
| devices/rtx/device/spatial_field/NvdbRegularField.cpp | Plumb NanoVDB filter choice into GPU data. |
| devices/rtx/device/spatial_field/NvdbRectilinearSampler_ptx.cu | Add nearest/linear sampling and optional gradients. |
| devices/rtx/device/spatial_field/NvdbRectilinearField.cpp | Plumb NanoVDB filter choice into GPU data. |
| devices/rtx/device/material/MDL.h | Default-initialize sampler descriptor members to safe values. |
| devices/rtx/device/material/MDL.cpp | Guard against null samplers and warn on failed default texture acquisition. |
| devices/rtx/device/gpu/volumeIntegration.h | Add sample-with-gradient path; compute volume normals at first contribution depth. |
| devices/rtx/device/gpu/shadingState.h | Extend NanoVDB sampler state to support nearest/linear samplers + filter flag. |
| devices/rtx/device/gpu/renderer/raygen_helpers.h | Accumulate volume normals from gradients; normalize material normals before accumulation. |
| devices/rtx/device/gpu/populateHit.h | Populate VolumeHit transform matrices from OptiX instance handle. |
| devices/rtx/device/gpu/gpu_objects.h | Introduce SpatialFieldFilter and store it in NanoVDB GPU data. |
| devices/rtx/device/gpu/gpu_math.h | Add worldToObject/objectToWorld matrices to VolumeHit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
devices/rtx/device/spatial_field/StructuredRectilinearSampler_ptx.cu
Outdated
Show resolved
Hide resolved
d1c595e to
b1903b5
Compare
2ccb229 to
52bcb98
Compare
52bcb98 to
e713fda
Compare
|
LGTM, thanks! |