|Status:||ready to commit|
While studying integrators and materials I saw something in the mcintegrator.cc code that didn't make much sense to me.
This is supposedly (as far as I understand) to be used in photon and path tracing for indirect illumination, and it gets the illumination that a randomly chosen light gives to a surface.
What does not make sense to me is that the result is multiplied by the total number of lights. I suppose this has something to do with a subsequent division by the total number of lights later on in the integration.
However, it looks "fishy" to me and the first thing I thought was: what happens if I make a scene with only one light, render it, and compare it with the same scene with that light plus other 5 lights that are in the scene but pointing outwards so they don't illuminate the scene at all?
The results are disheartening
With Photon mapping, only one light:
Now, same scene with the same light plus other 5 spot lights pointing upwards (so they don't illuminate the scene). As I was afraid of, due to that "number of lights" multiplication effect now the indirect light is incorrectly calculated:
Same problem happens with path tracing. With only one light we get this render:
If we add 5 more spot lights pointing upwards, not illuminating the scene, we get this incorrect result:
I don't know... I'm still trying to understand how Yafaray integration and materials work and I could be wrong, but this all look very bad in my opinion. What do you think?
I will attach the scene itself to the first comment for your evaluation.