Whoever wants to contribute to this blog , posting his experiences on the same place, please send me a message !

Tuesday, May 8, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 11 (Light sampling)

What should happen if several lights appear into the scene ?

I mean : how do we select the appropriate light to get a sample from where the light path starts?

To solve this problem i used this simple two-legged method :

First Case: having only lights covering a non-zero area (no point lights)

If the lights in the scene  are not point lights(which do not have volume or cover any area) then i select the appropriate light according to this procedure :

a.I compute the area of the surface that each light covers
b.I compute the total area of the lights
c. Each light has the probability  pi  to be chosen depending on the percentage of the total light area belonging to it. pi = lightArea/totalLightArea

Second  Case : Scene contains (zero-volume and area) point lights

In the case that a point light resides in the scene, then we have the problem using the above procedure there is no possibility to be selected for sample creation. This is logical due to the fictional nature of the point lights.

The usage of very small lights (e.g. sphere lights with the smallest possible diameter) is not a solution because the image converges extremely slow with high variance.

So i select them according to the brilliance of each light. The probability to pselect each light is
pi= lightEmmision / totalLightsEmission

Where "lightEmmision" is the light emitting power (emission color)of each light and where " totalLightsEmission" is the sum of the emission of all the lights.

First Case : Three lights 2 spheres , 1 area light 

Second Case: there is a purple-ish point light at the black dot (added to the image for illustrative reasons)

ΝΕΧΤ POSTs: Schlick specular gloss , Depth of field , Better refractions and reflections  

No comments:

Post a Comment