SPPM luminance bug

Component:YafaRay Core
Category:bug report
Assigned:David Bluecame

Hi there

While doing tests about SPPM for another bug report, I have found this bug. After a certain number of passes are done with SPPM, the luminance of the image experiences a sudden shift and and the image becames overexposed. The number of photons to shoot for each pass is a factor, with 5 million photons the shift happens in pass 860 and with 2,5 M photons the shift happens in pass 1720 so it is consistent, once an amount of cumulative photons in the map is reached, something goes wrong. I have attached the scene. Tested in Windows 64bits builds of YafaRay 3.0.2. Grettings.

PD: IRE is disabled in the scene.

YCS2012-Ditte scene Demo 05a.zip1.39 MB



Confirmed also on Linux 64 bits builds of YafaRay.


Assigned to:Anonymous» David Bluecame
Status:active» ready to commit


Thanks for reporting this. I could replicate the problem with a simple scene (see attached) that reaches that situation in a reasonable amount of time. The example shoots 100 million photons per pass, and around pass 44 you can see the brightness sudden change.

As you already hinted in your issue description, I found the problem in the counter that counts the total accumulated photons. That counter uses an unsigned 32bit integer that overflows when it reaches around 4,300 million causing this problem.

I've changed that counter to an unsigned 64bit integer and the problem seems to be solved. The change is in this commit: https://github.com/YafaRay/Core/commit/2d42a53477111ab6d553ba56544f26c48...

This bug has been there a very long time, but it was probably undetected as before version 3 the photon shooting was single-threaded and it was much more difficult to reach 4,300 million photons. Now in v3 with the multi-threaded photon generation, it's much more likely that number can be achieved so this bug would happen more often.

In any case, this bug will be fixed in the next YafaRay version.

sppm_photons_issue.blend.zip 70.17 KB


Version:» <none>
Component:Code» YafaRay Core
Status:ready to commit» fixed

Fixed in the new version v3.2.0. See: http://www.yafaray.org/community/forum/viewtopic.php?f=15&t=5233


Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.