Importance Sampling

Practical and theoretical implementation discussion.
Igors
Posts: 17
Joined: Sat Jan 07, 2012 11:56 am

Importance Sampling

Post by Igors » Mon Apr 23, 2012 8:06 am

Hi All

I've implemented a simplest unbiased Monte-Carlo for indirect illumination - N rays are cast from point to hemisphere. It works but becomes very noisy for scenes with "bright spots", e.g. when a relative small area is lit a lot. In others areas only few rays (of all N) catch the spot, so need tons of rays to compensate. I realize I need to detect such areas, do sample them more accurate and adjust bias.

Which technique/theory would you recommend? Should I concentrate on "Instant radiosity" or there are other ways?

Thanks

stefan
Posts: 48
Joined: Wed Dec 21, 2011 8:57 pm

Re: Importance Sampling

Post by stefan » Mon Apr 23, 2012 4:48 pm

You have plenty of options: Instant radiosity, photon mapping, irradiance caching, radiance caching, bidirectional path tracing, metropolis light transport, SPPM, ...

Your next steps depend on what you want from your renderer - easy implementation, short render times, flicker free animation, no bias?

Igors
Posts: 17
Joined: Sat Jan 07, 2012 11:56 am

Re: Importance Sampling

Post by Igors » Mon Apr 23, 2012 5:25 pm

stefan wrote:You have plenty of options: Instant radiosity, photon mapping, irradiance caching, radiance caching, bidirectional path tracing, metropolis light transport, SPPM, ...
I'm asking about how to reduce noise/variance when one/single point is sampled. I realize the N (count of rays specified by user) can be small, so it seems logical to process (re)sampling in 2 or more passes to use rays info of neighbour sampled points. Or create cached data for further sampling passes. That's what I'm interested in.

Other aspects are not involved: like how to place samples, or how to estimate secondary illumination. Let's assume we've a point to sample, know its neighbours and can get light at each ray's intersection with scene. It's other story where it comes from.

Thanks

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Importance Sampling

Post by ingenious » Mon Apr 23, 2012 6:45 pm

I cannot understand what you're trying to achieve. Are you restricted to the setting, where you have one shading point and shoot final gather rays? In such case you want to shoot with higher probability inside the solid angle spawned by the brightly lit surface. This is tricky in general, but people have used photon maps and other methods to help steer sampling in these directions.

If you simply want to solve the problem, bidirectional path tracing (BDPT) is the most general unbiased way to go, and gives great results in such cased. Instant radiosity is one very special case of BDPT, which is simple to implement and also handles such cases easily. If you want good pictures with it, though, you have to make it biased via VPL clamping. Photon mapping will not help in this situation.
Image Click here. You'll thank me later.

stefan
Posts: 48
Joined: Wed Dec 21, 2011 8:57 pm

Re: Importance Sampling

Post by stefan » Mon Apr 23, 2012 7:39 pm

ingenious wrote:I cannot understand what you're trying to achieve. Are you restricted to the setting, where you have one shading point and shoot final gather rays? In such case you want to shoot with higher probability inside the solid angle spawned by the brightly lit surface. This is tricky in general, but people have used photon maps and other methods to help steer sampling in these directions.
For just that case, this might be an interesting method:
http://neulander.org/work/sketch2011.pdf

I haven't implemented it myself yet, but it looks very promising.

Igors
Posts: 17
Joined: Sat Jan 07, 2012 11:56 am

Re: Importance Sampling

Post by Igors » Sat May 05, 2012 8:10 am

stefan wrote: For just that case, this might be an interesting method:
http://neulander.org/work/sketch2011.pdf
Not very clear "how" - but thx anyway

Now I've implemented a simple adaptive sampling. If a ray delivers more color/energy, then "ray's cell" is sampled with additional rays and result is averaged. It works but it uses only "local" data (this ray only). So some illumination details can be missed.

It would be much better to use data of neighbour samples in passes. It's not very complex to save "paths" (point + direction + light) where most of light comes from. But I've no idea what to do with saved data during next pass. The rays layout is lost, storing all rays for each sample looks not realistic. Although I can cast extra rays in primary direction(s) but I can't integrate/rebias new data into previous result

metro
Posts: 1
Joined: Sat May 05, 2012 5:32 pm

Re: Importance Sampling

Post by metro » Sat May 05, 2012 5:43 pm

There are a couple of papers that of know of which do this. Some are pre-process which I guess you don't want. Lafortune had a 5D tree (http://citeseer.uark.edu:8080/citeseerx ... .1.23.2520) which seems good, and more recently there have been a couple that I know of: http://ieeexplore.ieee.org/xpl/login.js ... %3D5171420 , which uses a pre-process to seed important locations and adaptively sample them and http://onlinelibrary.wiley.com/doi/10.1 ... x/abstract , which adaptively samples cosine lobes. They might be a good starting point.

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Importance Sampling

Post by ingenious » Tue May 08, 2012 4:46 pm

A couple of months ago a paper on this topic, titled "A Significance Cache for Accelerating Global Illumination", appeared in Computer Graphics Forum:

http://onlinelibrary.wiley.com/doi/10.1 ... 911.d02t02
Image Click here. You'll thank me later.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Importance Sampling

Post by spectral » Tue May 08, 2012 6:51 pm

Has someone read this paper, how to compare it to an "improved" MLT algorithm ? Like "Noise aware MLT" ?

What about the memory usage ? I mainly think about a GPU implementation... where we still have some limits to the used memory !
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Importance Sampling

Post by spectral » Wed May 09, 2012 7:11 am

Please, can you show which kind of scene you are talking about ?

So, first do you implement MIS or BDPT ? have you implemented basic MLT ? For sure it will help a lot !

Once done, you can also check for "noise aware" MLT and "Filtered Importance Sampling"
Spectral
OMPF 2 global moderator

Post Reply