Skip to content

Fix pathtracer double-counting ambient light - #642

Open
stefanatwork wants to merge 1 commit into
masterfrom
fix-pathtracer-ambient-double-count
Open

stefanatwork wants to merge 1 commit into
masterfrom
fix-pathtracer-ambient-double-count

Conversation

@stefanatwork

Copy link
Copy Markdown
Collaborator

Fixes #491.

The ambient light was added both when rays escape the scene and via next-event estimation in the per-vertex light loop, with no MIS weighting, so it was counted twice (~2x too bright; a diffuse plane with albedo 0.25 under unit ambient rendered 0.498 instead of 0.25).

This skips LIGHT_AMBIENT in the NEE loop in both pathtracer_device.cpp and pathtracer_device.ispc; the escape branch still accounts for it.

Skip ambient lights in next-event estimation since they are already
added when rays escape the scene. Fixes #491.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stefanatwork
stefanatwork force-pushed the fix-pathtracer-ambient-double-count branch from 81398c8 to 49e89ce Compare October 23, 2026 08:57
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.

The tutorial pathtracer double-counts the contribution of ambientlight

1 participant