r5 - 25 Feb 2009 - 14:48:50 - MattEstelaYou are here: TWiki >  Maya Web > WebLeftBar > MayaAnimation > MayaBatchRenderOptions > MayaCloth > MayaFluids > MayaFur > MayaJapan > MayaLightingShading > MayaLinks > MayaMelAndExpressions > MayaMentalRay > MayaFrameBufferTutorial

Framebuffer tutorial

Typical, a few months after I write this Autodesk release maya 2009, and framebuffers are all builtin, which is good, but quite broken, which is bad. You can't win. Go download 3delight and make life much easier for yourself.

This a summary more for my needs than for others, if you want a thorough run-down read the entry over at the render wiki.

The overview is create a buffer from the render globals, create a pass from the camera, connect them, set the output options. Create a simplepass shader, and connect a surface property to the matching slot, assign the simplepass shader to your object.

  1. Select your render camera, mentalray section, passes, create. Set the bit depth, image type, turn on file output, give it a suffix like 'colour' or 'specular'. Name the pass node for clarity.
  2. Render globals, down to framebuffers, open editor. This pops you to the AE, down to framebuffers again, create a user buffer. Name the node for clarity.
  3. Back to the camera, select the pass, and select the buffer you just made from the drop down.
  4. Create a simplepass material, assign it to your object, drag a material/node/blah to the 1st slot. This will be output to the first pass. You can't clearly visualise the links between the simplepass material and the output passes unfortunately, its just connected in order. First slot here to first output pass, second slot to second pass etc.

If you've skimmed through this stuff earlier you might be wondering when you connect that geometry shader. As of mentalray 3.6 and maya 2008 you no longer do this, all the functionality is now built-in to maya.


Internally maya and mentalray reserve the first buffer (buffer 0) for a glow pass. Normally you can just ignore this, but if you suddenly get everything glowing and awful, open the default glow material and disable everything. If you're actually using the glow (really? people use this?), then make sure you leave buffer 0 alone; create it, leave it disconnected, create another one, make that beauty. Ie, move all your buffers down a slot.

The fact that there's no clear link between the shader and the passes is kinda disconcerting. We found it useful to type into the notes panel what the pass numbers corresponded too. I suspect it'd be even clearer to name the buffers and passes with both their index and name, eg 'colour01buffer, spec02buffer, refl03buffer, ambocc04buffer' etc. I'd say once you do this for a few jobs the names and numbers would start to become consistent within a studio pretty quickly.

During the creation process you have to keep moving between 3 areas; the render globals, the camera shape and your material. Fine for a single pass, frustrating for 10 passes and when you're racing a deadline. This is definitely something that needs to be scripted (in fact there's versions here, here and here ), but I think I'll have a stab at this too.

Using the AE 'copy tab' feature is useful to avoid running back and forth, except it doesn't update a lot of the names once a tab has been torn off, so you have to keep closing and refreshing anyway.

You can only use a suffix for the outputs, so renders pop out in the format myscene.0001.specular.iff. Desktop apps work with them ok, but flame displays the prefix part only. Plus it bothered me. I wrote a little python script to fix a folder of passes, which I've posted in the MayaPython section.

There's a 'renderable' checkbox on the pass nodes that determines if it'll be created or not. Annoyingly you can't set this via render layer overrides, so if you're combining buffers with render layers you'll get hundreds of blank pass images for render layers not using the simplepass material. We got around this by using my render layer mel override code found elsewhere on this wiki.

Annoyances aside, framebuffers worked extremely well on a stressful production we just finished, saving us easily hundreds of hours of render time. We'll definitely use them more in future.

-- MattEstela - 20 Jul 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback