TU Wien Rendering #26 - Low Discrepancy Sequences

Károly Zsolnai-Fehér covers low-discrepancy sequences like Halton and Sobol as alternatives to random sampling in rendering. They spread samples more evenly across space, reduce flicker in animations, and converge faster. But they're tricky to implement correctly: dimension correlations create artifacts, and naive stratification breaks down in higher dimensions.
Questions this video answers
25 frames per second.
Chapters
Lets talk about all these preferences series. What we have been talking about so far is random sampling. This means that I have a random number generator, it generates samples, and this is the sample that I'm going to use. And many mathematicians were thinking that we could perhaps do much better than that. Because what I would be looking for is the hemisphere. And I would be shooting samples on the surface of this hemisphere. I would create unit vectors on the surface of this hemisphere. And I could do this deterministically. What if I have an algorithm that doesn't generate random numbers, but it will make sure that this hemisphere, If I have 100 samples, the samples are well distributed on this hemisphere. And if you do this, you may get much better convergence and much better looking results. So below you can see a random number generator generated samples in 2D. And up there the Halton sequence, which is called a low discrepancy series. What this means is it's not completely random, but it tries to fill the space reasonably uniform. Now this is not trivial. If you read after it, what you would think is that you would just get a grid in 2D. It would be very simple to get a grid and just put points in the midpoint. And then you would have samples that are really well distributed. And this you can do in 2D, this you can do in 1D on the line just given the space. So this works there. But there are mathematical proofs that tell you that this is absolutely terrible in higher dimensions. So if you have higher dimensional spaces, then this is not well stratified. So the most commonly used sequences are the Hawthorne series, the Sohl series and Pontecorkut series. You can do this low discrepancy sampling in many different ways. And this, that just gives you an even ish distribution of the noise because you are sampling these hemispheres reasonably, in a reasonably stratified way. So it cannot really be that one side of the hemisphere is sampled almost exhaustively and the other one is completely neglected. So you would get images with a noise distribution that's better for your eye. So that's a plus. But what is even more important is that this is deterministic. So if you're rendering an animation, imagine completely random sampling. You have frame number one, you distribute your samples, then comes frame number two. And then you distribute your samples in a completely different way. So the noise would look like this on frame one and that on frame two, completely different. So until you have converged perfectly, you will have these issues that we call temporal flickering or temporal coherence issues. Because the noise looks like this on frame one, looks like that on frame two. And if you play 25 of these frames every second, or maybe even more, then you will have a really disturbing tinkering effect. You are computing different things in every frame. And the Sobol series and overall discrepancy series calculate them. So they love to use the same industry. Because of this reason, in the subsequent frames, we'll compute the very same thing. Advantages. Okay. Disadvantages. Well, the disadvantages are also huge. It's often not trivial to implement such a thing. If you take a look at this image, these walls are not textured. These are one color green. This is a one color green diffuse wall, and this is a one tower red diffuse wall. This shouldn't be rendered like this at all. This is a buggy image. And I have implemented the Halton sampler. And the problem that I encountered was called correlating dimensions. And this is a serious problem that you can encounter. I will not go into the details, but you just mess up with one small detail and you can get an image like that. Well, this is actually a delightful way of failing. I don't know about you, but most of my programming errors and this calculation don't look like this. They tend to look like this. So I usually read segmentation fault and stuff like that. So if you make a mistake in global illumination rendering, even your errors might look better than in other fields.










