Skip to content

Improve Light Handling and Rendering Quality#216

Open
tarcila wants to merge 11 commits intoNVIDIA:next_releasefrom
tarcila:more-renderer-fixes
Open

Improve Light Handling and Rendering Quality#216
tarcila wants to merge 11 commits intoNVIDIA:next_releasefrom
tarcila:more-renderer-fixes

Conversation

@tarcila
Copy link
Collaborator

@tarcila tarcila commented Feb 5, 2026

Misc lighting and MDL related fixes:

  • Refactor light instances into a dual-bucket flatten list, separating HDRI lights from regular lights. This enables:
    • processing HDRIs as standard lights for DirectLight lighting evaluation and next event evaluation on PT
    • using HDRIs as background, correctly taking their transformation in account
  • Accumulate contributions from all visible HDRI lights for background rendering
  • Implement correct transmission approximation for DirectLight and MDL shaders
  • Reverting MDL distilling to use diffuse mode, after fixing related shaders. This enables MDL to:
    • correctly export to the albedo AOV
    • provide sensible value to Raytrace/AO renderers
  • Render albedo AOV as sRGB data for correct display

The instance lights flattening will help further work on light sampling,

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.
@tarcila tarcila requested a review from Copilot February 5, 2026 22:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>
@tarcila tarcila requested a review from jeffamstutz February 5, 2026 22:50
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