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

Saturday, May 5, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 10 (Importance sampling)

Up until the last post , i have been using a very naive importance sampling. I found the several combinations of paths for each pixel , the color of which was finally the average value of the light gathered from the various paths. This had the problem that a very probable path e.g. a path with 3 hops from the eye hitting the light , had the same weight in the total light gathering with a very long path which was a lot less probable to happen.

I have changed the weights of the paths in a manner that the more probable the paths are, the more is the contribution of that path into the final gathering.

So i used , a weighted average such as this : 

In this figure the w(x) is the weight of the path x , and p(x) is the probability of this path actually happening
So i had these results with the exact same materials and scene : 

Without Importance Sampling (1/N)

With weighted importance sampling

NEXT POST : I have also implemented the specular gloss material ,as described by Phong model, and i am implementing the Schlick metallness coefficient right now


  1. Hi,

    It looks like there is no indirect light when you use IS ! Check the shadows... if you have a naive path-tracer it will help you to test the correctness of the result ;-)

  2. I have now seen that and i 'm trying to find the mistake. I was to eager to post that i overlooked it

    It will be ok very soon

  3. This comment has been removed by the author.

  4. I found one mistake and re-checked everything, uploaded a better image. I think that you should also consider the lack of tone mapping at the moment.

    Everything is linear so some tone mapping should be nice.

    I will check it again but i cannot see anything else.
    Generally as a work in progress , i debug the code frequently.