![]() Los Angeles mental ray® User Group |
![]() | ||||||||||||
| |||||||||||||
Resources Sections General Install/Setup Options Settings Performance Optimizations mi Scene File FG/AO/GI Subsurface Scattering Shiny Stuff mrfm (Maya) Shader Writing Hair and Geometry Shaders | Maya User Framebuffer TipsUser Framebuffers can be useful for splitting up a render into several component passes at render time, to be used later for compositing. Version 3.3 of mental ray (Maya 6) allows up to 8 user framebuffers, but the functionality is not enabled from the Maya UI. Complementary shaders that know how to write into these framebuffers are required to take full advantage of this workflow, but it may not be as hard as you think. First, lets talk about how to do this with mi files and vanilla mental ray standalone. It requires:
mi_fb_put/get accesses samples. The output statements in the camera block relate these sample-based framebuffers to pixel based image files. When you choose a filter type (Render Globals), you are specifying how these samples are converted into pixels.In the current versions of Maya, by default there is no UI to setup the framebuffers in the option block, and output statements in the camera block. However, there is a mechanism called Custom Text that allows you to specify such things when you export mi files. Be careful, this doesn't mean you can interactively render from Maya and get the same behavior. That takes a little more work, which we'll talk about further below. First, thanks to Andy Lomas, we'll show some example MEL scripting that implements the Custom Text method. Custom Text methodAs Andy states, "Here's some mel that I've used in the past with Maya 5.0 to set up framebuffer output using mrmaya. It might need a bit of modification for Maya 6.0, but the principle should work.": Now you may notice that those are floating point framebuffers, and he's only showing use of 7 of 8 available. But keep in mind that these are samples, which get filtered into pixels between the framebuffer and output image stage. So your image output data can be specified as either integer or floating point RGB. Now you can use Interactive methodIn order to make this happen interactively from Maya, you can enable the framebuffers by hacking a hidden feature, and then write a shader that does the equivalent of setting up the output statements. Some folks have hacked this into a geometry shader. Or, since it can have access to all the framebuffers, an output shader might be able to write some pass files for interactive use. More on this later... The hidden feature which enables the framebuffers in Maya 6 is in a mental ray AE template file called |