# ***** demosupersamp - demonstration of supersampling patterns ***** # Marc Levoy, 4/10/96, 4/15/97 # 20 degree tilted square polygon, 1x1 samp/pix # Looks jaggy load samp_1x1_20deg.pix a1 # 20 degree tilt, 3x3 regular # (box enclosing samples slightly overlaps with boxes in adjacent pixels) # Looks good load samp_3x3_20deg.pix b1 # 20 degree tilt, 7x7 regular # Only slightly better load samp_7x7_20deg.pix c1 # 2 degree tilt, 1x1 # Looks jaggy load samp_1x1.pix a2 # 2 degree tilt, 3x3 regular # At this tilt, acts almost like only 3 samples/pixel load samp_3x3reg.pix b2 # 2 degree tilt, 7x7 regular # Looks good, but only like 7 samples/pixel load samp_7x7reg.pix c2 # 2 degree tilt, 3x3 jittered # Looks like 9 samples/pixel, but noisy load samp_3x3jit.pix b3 # 2 degree tilt, 7x7 (?) jittered # Looks even better, like 49 samples/pixel load samp_7x7jit.pix c3 # 2 degree tilt, 1x1, postfiltered w. Gaussian # Sigma = 0.4 x (filter_scale=4.0) / 2 = 0.8 # Blurry jaggies, just as you would expect load samp_post_4.pix b4 # 2 degree tilt, 1x1, postfiltered w. Gaussian # Sigma = 0.4 x (filter_scale=8.0) / 2 = 1.6 # Blurrier jaggies load samp_post_8.pix c4 Note: As discussed in class, these images were produced by a ray tracer, not a rasterizer, thereby providing more flexibility in the sampling patterns that can be employed. For example, "jittered" above means stratified random sampling, with a uniform subdivision of the distance between pixel centers into a grid of strata (3 x 3 or 7 x 7), followed by randomly and uniformly placing one sample in each stratum. In particular, the placement of samples in corresponding strata strata are independent from pixel to pixel. This independence manifests itself as a non-monotonicity in plots of intensity across scanlines in the vicinity of a polygon edge. This non-monotonicity can be seen in the images. If the samples were instead identically placed in each pixel, then these plots would be monotonic. Standard rasterization algorithms are only capable of such identical placements of samples across pixels, as discussed in class.