Skip to content

Instantly share code, notes, and snippets.

@breakin
Created September 9, 2016 20:27
Show Gist options
  • Save breakin/ed737ab44356b76ff21fc0c03e27e811 to your computer and use it in GitHub Desktop.
Save breakin/ed737ab44356b76ff21fc0c03e27e811 to your computer and use it in GitHub Desktop.
Explicit sampling
So let us say that we want to do area lights.
We could either shoot at them on purpose (explicit) or just consider them if you happen to land on them (implicit).
Right now you are both using the implicit method which only works for very large light sources
(or for very sharp reflections if you do importance sampling of brdf).
In the explicit method you don't include contribution from emissive surfaces if you land on them
(except if you do so directly from the eye).
Instead you shoot a shadow ray towards that light from each point on your path traced path.
So you do get indirect lighting from them.
Instead of sampling full scene by choosing a random direction you sample full scene minus direct area lights,
and then you sample area lights on the side in an unbiased way.
Like Alan say it is easy for a point light - there is only one shadow ray to consider - but for area light you can turn to monte carlo sampling again.
You pick one random point on the area light. The probability of choosing that point is 1/area_light_area. So that is your p(x).
Then since you are doing sampling of geometry instead of directions you need to include the geometric term (which basically makes it look
like a point light falloff, 1/distance^2 factor etc.).
Then an extension to this is to use multiple importance sampling where you can both use explicit and implicit sampling without
getting double contribution.
Feel free to ask more questions!
@Atrix256
Copy link

Atrix256 commented Sep 9, 2016

Thanks for writing that up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment