{"id":635,"date":"2009-01-18T16:12:23","date_gmt":"2009-01-18T22:12:23","guid":{"rendered":"http:\/\/www.mrbluesummers.com\/?page_id=635"},"modified":"2012-02-21T17:18:33","modified_gmt":"2012-02-21T17:18:33","slug":"introduction-to-anti-aliasing","status":"publish","type":"post","link":"http:\/\/www.mrbluesummers.com\/635\/3d-tutorials\/introduction-to-anti-aliasing","title":{"rendered":"Introduction to Anti-Aliasing"},"content":{"rendered":"

Hello Everyone,<\/p>\n

So we’ve all heard about anti-aliasing, but what is it really?\u00a0 In this tutorial I’ll be giving you a background on what anti-aliasing and sub-sampling mean in 3dsMax so that you can jump into a production setting with some understanding right off the bat.\u00a0 We’ll start off by looking at anti-aliasing in the scanline renderer, followed by sub-sampling in the scanline renderer and mental ray, and finally we’ll review anti-aliasing in mental ray.<\/p>\n

What is Anti-Aliasing and Sub-Pixel Sampling?<\/h2>\n

Rendering in 3dsMax is a very literal process.\u00a0 The renderer takes samples of what the camera sees and converts them into pixels.\u00a0\u00a0 Only the geometry at the very center of the pixel is considered.\u00a0 Sub-pixel sampling and anti-aliasing are two sides of the same coin.\u00a0 One operates before the pixel is rendered, while the other operates afterward.\u00a0 Sub-pixel sampling is the process of taking more than one sample per pixel and blending them together before the pixel is returned as part of the image.\u00a0 Anti-aliasing is taking the pixels after<\/em> they’ve been produced in the image and blending them together to remove harsh edges.<\/p>\n

\"Notice<\/p>\n

Notice the jagged edges in the version without anti-aliasing!<\/p>\n<\/div>\n

That said, sub-pixel sampling is a smarter but more intense process, so there needed to be a way to quickly take the edge off the final image.\u00a0 That’s why we have anti-aliasing.\u00a0 Note that anti-aliasing and sub-pixel sampling take time, and disabling them will make your renders go faster (though they aren’t as pretty).<\/p>\n

But what methods of anti-aliasing and sub-pixel sampling are best?\u00a0 There have been several revolutions on both fronts in 3dsMax.\u00a0 mental ray and the scanline renederer have methods that each deliver a distinct (albeit subtle) flavor of image smoothing.\u00a0 Let’s blast through examples of each and get acquainted with the options available.<\/p>\n

Scanline Anti-Aliasing<\/h2>\n

What I’m going to do here is elaborate on the descriptions provided in the 3dsMax help file.\u00a0 The fact is that whoever wrote this particular article didn’t really go into much detail about what each method looks like, so I’m going to fill in the gaps for you.\u00a0 Each of these renders was taken at the resolution you see on your screen, and each method was left on default values.\u00a0 I used a marble texture because it has plenty of hard edges to be smoothed.<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Method<\/th>\nDescription<\/th>\nComments<\/th>\nImage<\/th>\n<\/tr>\n
Area<\/p>\n

(default)<\/td>\n

Computes antialiasing using a variable-size area filter. This is the original 3ds Max filter.<\/td>\nThe original filter isn’t bad. Think of it as a gentle Gaussian blur.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Blackman<\/td>\nA 25-pixel filter that is sharp, but without edge enhancement.<\/td>\nThis one is a little tighter than the Area method, but it doesn’t explicitly sharpen the image.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Blend<\/td>\nA blend between sharp area and Gaussian soften filters.<\/td>\nWicked blurry for this resolution, but otherwise a nice smoothing method.\u00a0 Notice the edges are still crisp.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Catmull-Rom<\/td>\nA 25-pixel reconstruction filter with a slight edge-enhancement effect.<\/td>\nCrisp with sharpened edges.\u00a0 No options on this one.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Cook Variable<\/td>\nA general-purpose filter. Values of 1 to 2.5 are sharp; higher values blur the image.<\/td>\nA little blurrier, but the edges are retained in an overlay-like fashion, even for high values.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Cubic<\/td>\nA 25-pixel blurring filter based on a cubic spline.<\/td>\nBlurrier than Cook Variable without edge enhancement.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Mitchell-Netravali<\/td>\nTwo-parameter filter; a trade-off of blurring, ringing, and anisotropy. If the ringing value is set higher than .5 it will impact the alpha channel of the image.<\/td>\nA more robust filter, the default values look like Catmull-Rom.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Plate Match\/MAX R2<\/td>\nUses the 3ds Max 2<\/em> method (no map filtering) to match camera and screen maps or matte\/shadow elements to an unfiltered background image.<\/td>\nA legacy method.\u00a0 It’s generally for matte-shadow composition.\u00a0 See the F1 help file for more details.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Quadradic<\/td>\nA 9-pixel blurring filter based on a quadratic spline.<\/td>\nSimilar to cubic; general blurring.<\/td>\n\"\"<\/td>\n<\/tr>\n
Sharp Quadratic<\/td>\nA sharp nine-pixel reconstruction filter from Nelson Max.<\/td>\nNot much to say; similar to the Quadradic shown above.<\/td>\n\"\"<\/td>\n<\/tr>\n
Soften<\/td>\nAn adjustable Gaussian softening filter for mild blurring.<\/td>\nGaussian blurring.\u00a0 Similar to Cubic and Quadradic, this is general blurring without edge enhancement.<\/td>\n\"Area\"<\/td>\n<\/tr>\n
Video<\/td>\nA 25-pixel blurring filter optimized for NTSC and PAL video applications.<\/td>\nFor use when rendering video with the 3dsMax scanline renderer.<\/td>\n\"Area\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Scanline Super-Sampling<\/h2>\n

Super-sampling in the scanline renderer is what you use to control the sub-pixel activity of the renderer. This is different from anti-aliasing because, while it controls edge blending, it does so through sub-pixel sampling rather than through pixel bleeding.<\/p>\n

\"Here<\/p>\n

Here is where you can find the super-sampling controls.<\/p>\n<\/div>\n

Below I’ve included a table showing you example renders for each of these super-sampling methods. I’ve used the same example scene as before, and I’m using the default area anti-aliasing method. Again, I left the default values for each sub-sampler and these images were rendered using the 3dsMax scanline renderer at the resolution you see on your screen. Remember that using sub-sampling will slow down your renders considerably more than anti-aliasing!<\/p>\n\n\n\n\n\n\n\n
Method<\/th>\nDescription<\/th>\nComments<\/th>\nImage<\/th>\n<\/tr>\n
Adaptive Halton<\/td>\nSpaces samples along both X and Y axes according to a scattered, “quasi random” pattern. Depending on Quality, the number of samples can range from 4 to 40.<\/td>\nSimilar to Hammersley, but provides a randomization that extends the uniform variant.<\/td>\n\"\"<\/td>\n<\/tr>\n
Adaptive Uniform<\/td>\nSpaces samples regularly, from a minimum quality of 4 samples to a maximum of 36. The pattern is not square, but skewed slightly to improve accuracy in the vertical and horizontal axes.<\/td>\nProvides a generally sharper outcome.<\/td>\n\"\"<\/td>\n<\/tr>\n
Hammersley<\/td>\nSpaces samples regularly along the X axis, but along the Y axis it spaces them according to a scattered, “quasi random” pattern. Depending on quality, the number of samples can range from 4 to 40.<\/td>\nProvides a generally smoother outcome. This method is not adaptive!<\/td>\n\"\"<\/td>\n<\/tr>\n
Max 2.5 Star<\/td>\nThe sample at the center of the pixel is averaged with four samples surrounding it. The pattern is like the fives on dice. This is the
\nsuper sampling method that was available in 3ds Max 2.5.<\/td>\n
Provides the smoothest outcome. This method is not adaptive either.<\/td>\n\"\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

The two adaptive methods are named so because they adapt to the change in pixel contrast while the renderer is operating. In areas of low contrast, the sub-sampler will back off and move more quickly, while in areas of high contrast, the sub-sampler will work more deeply. You’ll see a similar feature in the mental ray renderer soon.<\/p>\n

mental ray Sub-Pixel Sampling<\/h2>\n

In mental ray, we don’t have super-sampling, we have “sub-pixel sampling”. This gives us a very robust level of control over how mental ray samples each pixel in our image.\u00a0 Rather than rely on a forumla to handle sampling, we can simply tell mental ray the sampling levels for high contrast areas versus low contrast areas.\u00a0 We do this with the Samples per Pixel controls in the “Render Setup” rollout, similar to the scanline methods.<\/p>\n

\"These<\/p>\n

These two pull down menus control the minimum and maximum sampling.<\/p>\n<\/div>\n

The sampling in mental ray is given as a number or a fraction.\u00a0 The whole values indicate how many samples should be taken per pixel (i.e. a value of 1 is just one sample per pixel, while a value of 4 is 4 samples per pixel).\u00a0 Fractional values indicate how many pixels can be filled with a single sample.<\/p>\n

\"mental<\/p>\n

mental ray sub sampling at 1\/4 and 4<\/p>\n<\/div>\n

You can probably already see the implications of such a system.\u00a0 If you set the maximum and minimum sampling to 1\/4, you’ll get a very blocky, but very fast render.\u00a0 On the other hand, if you set the maximum and minimum sampling to 4, you’ll get a slow but clean render.<\/p>\n

Without getting lost in the minutia of 3dsMax mental ray sub-sampling, I’ll also point out that there is a spatial contrast group just below the samples per pixel group.\u00a0 This group controls how mental ray should chose between your minimum and maximum sampling levels based on the contrast across pixels.\u00a0 By default this is set to [5, 5, 5, 5] which is just shy of a 1% difference across pixels when rendering.\u00a0 However, you can change the threshold to a higher value if you want mental ray to bias itself toward the minimum (faster) sampling instead of the maximum (higher quality) sampling.<\/p>\n

Anti-Aliasing in mental ray<\/h2>\n

Finally, let’s look at the anti-aliasing options in mental ray. Since there are only 5 flavors of smoothing, I’m going to include two sample images for each instead of just one. The first image will be using the default values, while the second image will show double the default values. For example, the box smoothing in mr is defaulted at width:1.0 and height:1.0. In image 2 for that method, the values are width:2.0 and height:2.0.<\/p>\n

As with the 3dsMax scanline anti-aliasing examples, these images are all rendered at the resolutions you see on your screen. All other mental ray settings are left at defaults (including the sub-sampling levels of 1\/4 minimum and 4 maximum).<\/p>\n\n\n\n\n\n\n\n\n
Method<\/th>\nDescription<\/th>\nComments<\/th>\nImage<\/th>\nImage<\/th>\n<\/tr>\n
Box filter<\/td>\nSums all samples in the filter area with equal weight. This is the quickest
\nsampling method.<\/td>\n
Typical blurring; just blends the adjacent sub-pixels together.<\/td>\n\"\"<\/td>\n\"\"<\/td>\n<\/tr>\n
Gauss filter<\/td>\nWeights the samples using a Gauss (bell) curve centered on the pixel.<\/td>\nThe Gauss filter appears blurrier because it has a larger default size (3,3) than the box filter.<\/td>\n\"\"<\/td>\n\"\"<\/td>\n<\/tr>\n
Triangle filter<\/td>\nWeights the samples using a pyramid centered on the pixel.<\/td>\nGenerally yields crisper results.<\/td>\n\"\"<\/td>\n\"\"<\/td>\n<\/tr>\n
Mitchell filter<\/td>\nWeights the samples using a curve (steeper than Gauss) centered on the pixel.<\/td>\nGenerally considered the best filter in mental ray.<\/td>\n\"\"<\/td>\n\"\"<\/td>\n<\/tr>\n
Lanczos filter<\/td>\nWeights the samples using a diminishing, but steep curve.<\/td>\nA fine filter that accentuates detail.<\/td>\n\"\"<\/td>\n\"\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

And that’s the rundown!I hope this tutorial has given you an idea of what anti-aliasing and sub-sampling are all about in 3dsMax. Just remember that it’s a quality\/speed trade off like most things in computer graphics. You need to find the happy medium in order to come off a head. When in doubt, aim for faster (usually lower) values when testing, and quality (usually higher) values when doing your final output render.<\/p>\n

Until next time, happy rendering!<\/p>\n","protected":false},"excerpt":{"rendered":"

Hello Everyone, So we’ve all heard about anti-aliasing, but what is it really?\u00a0 In this tutorial I’ll be giving you a background on what anti-aliasing and sub-sampling mean in 3dsMax so that you can jump into a production setting with some understanding right off the bat.\u00a0 We’ll start off by looking at anti-aliasing in the […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,20],"tags":[29,2569,70,2567,22,88],"_links":{"self":[{"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/posts\/635"}],"collection":[{"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/comments?post=635"}],"version-history":[{"count":0,"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/posts\/635\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/media?parent=635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/categories?post=635"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mrbluesummers.com\/wp-json\/wp\/v2\/tags?post=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}