About volumetric caustics.

Practical and theoretical implementation discussion.
shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: About volumetric caustics.

Post by shiqiu1105 » Thu Nov 14, 2013 8:32 pm

friedlinguini wrote:What mumbo-jumbo is that? Kelemen-style MLT doesn't require much. You need to to feed sample results back to the random number generator, and let the thing warm up a bit to generate an average intensity and eliminate start-up bias. Otherwise it's not really any more complicated than, say, replacing a naive RNG with a QRNG. Is there something else?
Is it really that simple?! I am using a QRNG already. I am using sobol sequence.
Is MLT just a matter of replacing the RNG?!

zsolnai
Posts: 24
Joined: Thu Mar 15, 2012 1:49 pm

Re: About volumetric caustics.

Post by zsolnai » Thu Nov 14, 2013 8:45 pm

The Primary Sample Space MLT by Kelemen et al. [1] is mostly about manipulating the random number generator. The original Veach Metropolis [2] is however a different story.

[1] http://www.iit.bme.hu/~szirmay/paper50_electronic.pdf‎
[2] http://www-graphics.stanford.edu/papers/metro/

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: About volumetric caustics.

Post by Dade » Thu Nov 14, 2013 10:20 pm

toxie wrote:But that doesn't include all the additional mumbo-jumbo that the rest of the renderer has to support to make it "simple" like this..
The above code just generated (on demand, it implements Kelemen-style lazy evaluation) float values as the most simple Random Sampler, there isn't any particular support to add around the code. The main real difference, when compared for instance to a Random or Sobol Sampler, is the requirement to "close the loop" (i.e. the Sampler needs to know the sampling result before to generate a new value). Metropolis is also tile-rendering unfriendly (i.e. doesn't make very much sense in that case) but otherwise is easy to implement.

Now, if we talk about GPUs, that is a different matter. MTL has some peculiar limit on GPUs.

P.S. indeed, I'm talking about Kelemen's Metropolis. I don't see the point in implementing Veach's Metropolis after Kelemen's paper. It doesn't seems worth the (insane) effort to me.

friedlinguini
Posts: 89
Joined: Thu Apr 11, 2013 5:15 pm

Re: About volumetric caustics.

Post by friedlinguini » Fri Nov 15, 2013 2:41 am

shiqiu1105 wrote:Is it really that simple?! I am using a QRNG already. I am using sobol sequence.
Is MLT just a matter of replacing the RNG?!
There's more to it than that, but not much. There's the warm-up that I mentioned, you let the RNG dictate where to place samples rather than iterating over pixels, and you have to scale the intensity of the individual samples, since messing with the RNG changes the PDF of the sample. For bidirectional path tracers there's some funkiness about keeping dimensions in random number space associated with path segments, but the same logic would apply to QRNGs (you don't HAVE to do it, but it helps). Paper [1] that zsolnai mentioned lays it all out pretty completely, including code.
Dade wrote:P.S. indeed, I'm talking about Kelemen's Metropolis. I don't see the point in implementing Veach's Metropolis after Kelemen's paper. It doesn't seems worth the (insane) effort to me.
Veach's MLT is more computationally efficient, since it lets you reuse portions of the path between mutations, but it's harder to get right.

I find it truly weird that there has been almost no additional research done in primary sample space MLT. I think Csaba Kelemen posted some code for a newer version (on the original ompf, in fact) at one point, but with no explanation about its workings. That code still exists at http://www.hungrycat.hu/MetropolisSampler.html. It's terrifyingly short and supposedly doesn't need the warm-up phase.

shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: About volumetric caustics.

Post by shiqiu1105 » Fri Nov 15, 2013 6:41 am

Anyway, I guess the take home msg for volumetric caustics is I need to at least do a Metropolis sampled BDPT right?

And, besides sampling methods, I am also quite unsure about how to implement multiple scattering with BDPT or PT either. Any recommended tutorial?

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

Re: About volumetric caustics.

Post by ingenious » Fri Nov 15, 2013 7:52 pm

shiqiu1105 wrote:Anyway, I guess the take home msg for volumetric caustics is I need to at least do a Metropolis sampled BDPT right?
First try basic BPT. It may work well for your scenes. You can then add Metropolis sampling on top.
shiqiu1105 wrote:And, besides sampling methods, I am also quite unsure about how to implement multiple scattering with BDPT or PT either. Any recommended tutorial?
I haven't seen a tutorial, but there was some SmallPT-like code around that included participating media. In a nutshell, you do standard PT/BPT, just that a path can also scatter in media. So the vertices on a path can be either in a medium or on a surface.
friedlinguini wrote:There's the warm-up that I mentioned...

...I think Csaba Kelemen posted some code for a newer version (on the original ompf, in fact) at one point, but with no explanation about its workings. That code still exists at http://www.hungrycat.hu/MetropolisSampler.html. It's terrifyingly short and supposedly doesn't need the warm-up phase.
I think there are some misconceptions about MLT, warm-up and bias. The problem seems to root in the thesis of Veach, who made MLT unbiased, but did not clearly state that in order to converge to the correct solution you need to average over many independent chains. His warm-up method performs simple resampling of paths to choose the initial element in the chain from a distribution that is closer to the target. He then described an algorithm that uses a single chain for the whole image. This algorithm is unbiased, but does not converge with a single chain due to the chain weighting. The ERPT paper showed that you can indeed go without a warm-up phase and instead sample many independent chains. If Veach had pointed this out more clearly in his thesis, the ERPT paper could have been much harder to get published :) There's obviously the trade-off here between adaptation (a few long chains) and stratification (more short chains). We've discussed this topic on the OMPF before. One could argue that a longer chain is better when you have very difficult paths to find, but one should keep in mind that in such scenes the warm-up phase needs to sample a much higher number of initial candidates so as to obtain a reasonably accurate scaling factor.

Edit: OK, Veach's algorithm actually samples a number of chains. But there's no fundamental requirement to do the warm-up. Interestingly, the one-chain algorithm actually corresponds to traditional Metropolis sampling, where the weighting obtained in the warm-up phase is essentially the estimate for the target PDF normalization. So if you're doing one-chain MLT, I'd think it's better to forget about the warm-up and start-up bias, and do it the classic way where you accumulate the target PDF normalization on the side. This way you'll converge to the correct solution.

Sorry for turning the topic into an MLT discussion :)
Image Click here. You'll thank me later.

shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: About volumetric caustics.

Post by shiqiu1105 » Sat Nov 16, 2013 5:58 am

Now that we are discussing this, I am curious that if MLT like algorithm is so robust, why do we still care about algorithm like VCM?
Can MLT handle SDS path efficiently?

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

Re: About volumetric caustics.

Post by ingenious » Sat Nov 16, 2013 12:20 pm

shiqiu1105 wrote:Now that we are discussing this, I am curious that if MLT like algorithm is so robust, why do we still care about algorithm like VCM?
Can MLT handle SDS path efficiently?
It very much depends on the scene whether VCM or MLT would be more efficient. If you have complex visibility, MLT could be better. But if your make sure that the light can reach important regions easily, then VCM will be. I think that VCM should perform better for most scenes, and MLT is for the more pathological cases. But my opinion is biased :)
Image Click here. You'll thank me later.

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: About volumetric caustics.

Post by Dade » Sat Nov 16, 2013 4:11 pm

Does make sense to compare VCM and a Metropolis Sampler ? I mean, aren't they orthogonal and solve different kind of problems ? I use BPT+VCM with a Metropolis Sampler; there is nothing preventing to use both.

Anyway a Path racer with a Metropolis Sampler have no hope to render any no trivial SDS paths.

shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: About volumetric caustics.

Post by shiqiu1105 » Sat Nov 16, 2013 10:17 pm

Dade wrote:Does make sense to compare VCM and a Metropolis Sampler ? I mean, aren't they orthogonal and solve different kind of problems ? I use BPT+VCM with a Metropolis Sampler; there is nothing preventing to use both.

Anyway a Path racer with a Metropolis Sampler have no hope to render any no trivial SDS paths.
Yeah, I agree with you.

However I am really sick of the noise produced by Monte Carlo based methods like path tracing/BDPT.
The following is an image produced by my own BDPT renderer, over 1000 SPP but still quite noisy!

So is VCM, like photon mapping, able to give you an image that's noiseless much faster?
Or will irradiance caching helps BDPT get rid of the noise?
EDXResult.jpg
Also, is the white noise in the far door a bug in my BDPT..?
EDXResult.jpg (319.74 KiB) Viewed 6792 times

Post Reply