NVIDIAGameWorks / RTXGI-DDGI

RTX Global Illumination (RTXGI)
https://developer.nvidia.com/rtxgi
Other
696 stars 55 forks source link

Lighting artifacts at high light powers #74

Closed StoneWolf closed 1 year ago

StoneWolf commented 1 year ago

Hi,

In your test harness, setting high intensities for lights produces strange artifacts. You can reproduce the issue with the Cornell-box scene, setting the directional light's intensity to 4.6f and checking "Show Indirect Lighting". I attached a picture of the issue.

That made me wonder how would one implement a very bright scene, i.e. a sunny, outdoor scene. Instead of setting your sun's intensity to something very high, would you instead just multiply your indirect lighting by some factor when compositing?

Thanks!

light issue
acmarrs-nvidia commented 1 year ago

Hi @StoneWolf - thanks for pointing this out. I pushed a small fix to address the issue you've run into.

The core problem here is related to numerical precision limits. By default, the radiance calculated for a probe ray is packed into a R10G10B10 format to keep memory costs low(er). In the case above, the per ray radiance needs to be normalized before being packed to ensure we don't overflow the 10-bits available per channel. Depending on how a renderer computes and then uses probe ray radiance, this might not be the optimal solution - but it works reasonably well.

StoneWolf commented 1 year ago

Thank you, this works just fine!