Bit-Depth, Specs, and Anti-Aliasing

I just found a great blog post by Jason over at CGPipeline that brings up a couple of great issues that I forgot to mention in the lighting episodes:

First some specs:
I’m doing everything in HD res (1920×1080) @23.98 fps
The bit depth of the renders and composites is 16-bit linear.
The final master project will be 10-bit HDCam-SR (4:4:4 RGB) at 23.98PsF
I haven’t decided whether it’ll also be going out to film or not yet.

However, more directly addressing Jason’s post, the bit depth issue is CRUCIAL. If you’re doing any sort of compositing, 16-bit is essential. I’ve personally never found much cause to go to full-float, but I could see that being useful in some situations.

Jason also brings up the alpha issue which is something I’m fighting. I’ve never had much luck rendering straight alphas out of mental ray so I’m using premultiplied. In some cases, this has lead to edge issues. However, I’d also like to mention one other possibility that’s slightly more “out there” but works really well in certain cases.

The idea behind it is this: if you’re setting your antialiasing levels to anything above 0 in mental ray, then you are effectively “baking” data into pixel. That pixel now contains an average of a couple of different rays that each took a long time to render. So, what I’ll sometimes do instead is take the sampling down and increase the frame size. The rule is that for every step you decrease your sampling, you need to double the frame size. So…

If your settings are 0,2 and your frame size is 720×540
That is the same as -1,1 at 1440×1080
and also identical to -2,0 at 2880×2160

(Now, before anyone yells insanity and ships me off to the looney bin, this is a trick that I use very rarely and only when working with SD. However it has gotten me out of a pinch a couple of times.)

So essentially, this technique takes the exact same amount of time to render because the rays its rendering are identical in all three sizes, but it gives you every single ray as its own pixel (if you go as far as -2,0.) The only downside is the file size which gets EXTREMELY bloated. However, it opens up some great possibilities:

You can generate proxies and set your compositor to quarter res. It’s just like working with regular files, but you’ve got your super high-res master.

There are NO edge issues when you render out the full res. None, ever, period. Transparent objects still have their quirks though.

2D post effects such as Depth of field, motion blur, etc. work much better.

You can use the gaussian filtering on the pixels after compositing which solves a couple of other geeky technical issues.

The object IDs work flawlessly. Even if you don’t have object IDs, you can now use every single color rather than just RGB like I mentioned in Podcast #007

Anyways, that’s my crazy nerdy compositor side coming out again, but its just one more trick that can be handy to have in your bag. Of course, I didn’t use that trick on PI because the renders would have come out to 24TB (yes, terabytes) but as technology advances, it starts to become an interesting and more viable way of working. A big thanks again to Jason at CGPipeline.com for inspiring this rant and also the plug.

Bookmark and Share

3 Responses to “Bit-Depth, Specs, and Anti-Aliasing”

  1. Jason Clark Says:

    Thanks for the plug Lucas, I am flattered you found the site and post informative.

    Truth be told, I haven’t done a lot with unmultiplied alphas since most compositing apps are pretty smart in this regard. What I find really interesting is the math for the Mental Ray aliasing you present. Sofimage presents a good video on the aliasing routine and the subpixel resolution that it goes through (hence your ‘baking’ terminology). You present a good concept regarding the enlarge and downsample, and in some cases I’ve seen people do away with aliasing altogether and render at 4x size and allow the downsample aliasing clean the image. What makes this interesting is that you are saving a tonne of rendering time on the cases where reflection and refraction are used, since the downsample aliasing will do this.

    Some XSI specific & aliasing information: http://www.shaidacher.com/html/tutorials_rb.html

    One warning I have with this method (upsize and downsample) is that I find edges can get messy depending on the algorithms used, but in general for animation it can be to the advantage.

    I didn’t mean for the long reply, but this just great info to be sharing!! Thanks again for a terrific blog Lucas. I really like the depth of the information you go into.

  2. Simon Reeves Says:

    Interesting! I’ve never really rendered stuff out bigger for that reason. I have when I had something that I literally could not antialias like a wireframe render. But I can perhaps see the benefits relating to using IDs/DOF/motion vectors in post.

  3. Lucas Martell Says:

    Yeah when its time to downsample, the straight box sampling most compositors default to can get really nasty. I always use the gaussian filter in mental ray so I’ll just apply a very slight blur to the image before I downsample. I doubt that this is exactly the same as what mental ray does, but it fixes the edges problem and looks darn pretty. :)

Leave a Reply