When using mental ray to render a large image 6k x 6k for example, one often runs into a memory allocation issue and the render stops.
In this tutorial we will look into how to cut the render into segments without having a visible seam between the rendered tiles
There are 2 main steps to look at
1- Tile command line rendering
2- Final gather map
1- Tile Command line rendering
Example: rendering 500*800 resolution
render -r mr -reg 0 250 0 400 -im tile01 myFile.ma
The region flag “-reg” will render a small portion of the image defined by the pixel numbers (X-Y)
The image flag “- im” will output a specific name defined by the user
However when using this method while rendering with Final gather, the result might not be acceptable due to the visible lines between the tiles.
1- Final gather maps
Rendering the final gather map will fix the tiling problem.
We start by doing the following
|
In the metnal ray render settings > |
|
|
| |
|
We don’t need to render the entire image, we just need the FG map Change the render Mode to Render Final Gather Maps
|
|
Note: Maya 2009 has this option exposed in the main render settings window The FG map will be written in the following location Note: to view the FG map go to Window > rendering Editor >mental ray > Map Visualizer
C:\My Documents\maya\projects\default\renderData\mentalray\finalgMap
load the map file to view it in the perspective view
Now that the map is created, make sure you do the following
1- set the Render Mode to Full render rather than Render final gather Maps
2- Change the Final gather Rebuild to Freeze
Render from command line as a previously mentioned Now we have No seams in our tiles.
example: render -r mr -reg 0 250 0 400 -im tile01 myFile.ma
Hint: generating a Final gather map will help reducing flicker when rendering animation files.





Subscribe
Hi Ian,
The error you see is probably linked to the amount of data mental ray is trying to squeeze into a single frame buffer. Please read my latest post for more information about the different options of caching the frame buffer. I hope it helps you resolve this issue.
Owen
Posted by: Owen | 21/03/2011 at 05:46 PM
/Applications/Autodesk/maya2011.5/Maya.app/Contents/bin/Render -r mr -x 43400 -y 9800 -reg 0 5425 0 4900 -proj /Volumes/Ian\'s\ Maya\ RAID/STO_LED_boards FFL_scoreboard_07_centered.mb
it render a frame 1 px x 9800 px is my script wrong?
Posted by: Ian Zeigler | 17/03/2011 at 05:10 PM
Can you guys post the whole command you are trying to use? -r is basically a flag that calls a rendering engine. It should work as long as it is followed with the correct value such as sw, mr, mi etc.
Posted by: Nelson Cruz | 14/10/2010 at 05:17 PM
Im using a PC and i get a:
// Error: Invalid flag: -r
everytime i try use the code. Why?
Posted by: Nathan | 14/10/2010 at 11:41 AM
i get a: // Error: Invalid flag: -r
everytime i try use the code. Why?
Posted by: Nathan | 14/10/2010 at 11:20 AM
For mac OSX, -r isn't recognized in command line for render? Invalid Flag error comes up. Any idea what this command needs to be for Maya 2010 on Mac OSX to render using command line?
Posted by: Tyler | 28/12/2009 at 05:28 PM
Great guide... What is the maximum rendering image that Mental Ray can do? Is it "Just" a memory issue or is there a maximum like texture allocation on graphics cards. Like Maximum is 4096x4096 or even higher?
Posted by: Christian | 16/12/2009 at 11:51 AM
Great tips - however, im rendering a very large crocodile head and the textures are coming out all jagged and lores. Im using the PSD network which has size limitations as you set the parameters, and therein lies the problem i think. The map was origially created at 1024 square. Any tips greatly appreciated. I pump up the res in Pshop, but Maya does not like it. I may have to try via 64bit on the pc side i think.
Posted by: matt turley | 15/11/2009 at 01:28 AM