Improve Light Handling and Rendering Quality#216
Open
tarcila wants to merge 11 commits intoNVIDIA:next_releasefrom
Open
Improve Light Handling and Rendering Quality#216tarcila wants to merge 11 commits intoNVIDIA:next_releasefrom
tarcila wants to merge 11 commits intoNVIDIA:next_releasefrom
Conversation
Denoiser parameters were outdated for non directlight renderers
Changes: - All lights instances are flattened into the lightInstances - All hdri lights are in a separate bucket containing only HDRI lights This allows HDRI to participate in Next Event Estimation while maintaining separate access for background rendering.
When evaluating HDRI for background, the instance transform was being ignored. Actual lighting computation is already correctly using instance transforms.
Changed getBackground() to sum contributions from all visible HDRI lights instead of returning only the first one. This is consistent with how multiple HDRIs contribute to scene lighting.
Transmission information can directly be extracted from the main material.
This fixes albedo AOV (for demoising) and albedo based renderers such as Raytrace.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors light handling to improve rendering quality through better HDRI management and MDL shader fixes. The changes enable HDRI lights to be treated as standard lights while maintaining their transformation data, fix transmission approximation in materials, and ensure proper color space handling for albedo output.
Changes:
- Restructured light instances into separate arrays for regular and HDRI lights
- Corrected albedo AOV rendering to use sRGB color space
- Updated MDL shader distillation from transmissive PBR to diffuse mode with related shader fixes
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsd/src/tsd/rendering/pipeline/passes/VisualizeAOVPass.cpp | Changed albedo rendering to sRGB color space |
| devices/rtx/shaders/visrtx/physically_based.mdl | Fixed sheen layer weighting and added scattering coefficient for transmission |
| devices/rtx/libmdl/Core.h | Renamed distillation function from transmissive PBR to diffuse |
| devices/rtx/libmdl/Core.cpp | Updated distillation logic and cleaned up formatting |
| devices/rtx/device/world/World.h | Replaced single HDRI index with HDRI light instances array |
| devices/rtx/device/world/World.cpp | Implemented dual-bucket light flattening for regular and HDRI lights |
| devices/rtx/device/world/Group.h | Added public accessor for lights vector |
| devices/rtx/device/world/Group.cpp | Implemented lights() accessor method |
| devices/rtx/device/visrtx_device.json | Standardized JSON formatting and unified denoiser parameters |
| devices/rtx/device/renderer/DirectLight_ptx.cu | Updated to use flattened light instance structure |
| devices/rtx/device/material/shaders/MDLShader_ptx.cu | Added transmission approximation factor |
| devices/rtx/device/gpu/renderer/raygen_helpers.h | Added volume integration header include |
| devices/rtx/device/gpu/gpu_util.h | Implemented accumulation from multiple visible HDRI lights with transformation |
| devices/rtx/device/gpu/gpu_objects.h | Changed light instance structure to single light per instance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Misc lighting and MDL related fixes:
The instance lights flattening will help further work on light sampling,