Previous | Next --- Slide 55 of 79
Back to Lecture Thumbnails
degrees_K

It is not immediately intuitive why the samples are not in the middle of their quadrant of the pixel. One possibility I can think of is that doing it this way makes less of them line up, so you are less likely to have a long thin triangle slip between the samples and not get sampled at all.

keenan

@degrees_K Right: there are a bunch of considerations when picking a sampling pattern, like anisotropy (samples shouldn't line up strongly with special features like horizontal/vertical lines) and low discrepancy (the number of samples in a random region should be roughly proportional to the area of that region), as well as speed of evaluation. We'll talk about these issues in more depth when we get to Monte Carlo rendering. This blog post discusses the "4 rooks" sampling pattern shown here, with some Shadertoy examples.

ceviri

Is there value in having "fully random" sample patterns? It seems computationally intensive but maybe some pseudorandom pattern could tackle some of the Moire pattern-like issues that crop up.

keenan

@ceviri Yes! There's a very good reason to use a truly random sample pattern. For any fixed sampling pattern, you can construct adversarial examples that are sampled very badly---or not at all! (See your mini-homework...). If you choose samples at random, there will always be some nonzero probability that you hit any primitive of finite size. Random sampling is in fact the starting point for Monte Carlo rendering, which we'll talk about a lot later in this semester. It's a beautiful example of how randomization can improve the robustness of algorithms. (Another classic, and somewhat cleaner example is randomized quicksort)