As part of our static lighting pipeline here at Insomniac, we use Autodesk's mental ray. We often get questions about how we process this data and how we encorporate it into our tools.
Here's a quick summary for those of you who are interested from Dustin Reagan (Tools Programmer) who's done much of the work with our mental ray pipeline.
1. Wrote our own Content (insomniac tool format) to Mental Ray scene (.mi file) exporter.
•
This is not a full-blown Mental Ray scene exporter (doesn't support all or even most .mi objects)
•
It’s many times (at least an order of magnitude) faster than exporting the same scene from Maya.
2. We opportunistically create an .mi file for each art asset that is expected to go through the lighting pipeline.
•
Uses our dependency system to only generate this data when necessary.
3. Users create persistent "lighting jobs" in our level editor. Lighting jobs consist of:
•
Instances to create lighting data for.
•
Instances to cast shadows.
•
Global Mental Ray render options.
4. Rendering a Lighting job causes a lightweight Content Scene --> Mental Ray scene export to occur.
•
All the heavy-weight Mental Ray data is referenced into this scene file.
•
All referenced files are done so with network paths to the users machine (for remote rendering, see below)
•
Only per-instance data needs to be exported ( transforms & per-instance lighting parameters ).
5. Remote rendering is accomplished via irush ( a renderfarm job scheduler ) on our farm of blade machines.
•
Once a render job is picked up by a blade machine the following occurs:
•
If necessary, the user’s tools release is copied onto the blade machine.
•
The exported scene (.mi file ) is copied up to the blade machine and rendered with Mental Ray.
•
All referenced files (.mi object files, textures, etc ) are referenced with network paths to the user’s machine.
•
This allows us to avoid sync issues, or copying large amounts of data between the user’s machine and the render machine.
•
The output lighting data is condensed into a single file that is unique among Lighting jobs and copied to a shared network location.
6. The Lighting job render system is set up to allow rendering to occur outside of our level editor. This will allow stuff like:
•
An automated render process that is run over every production level, loading up all Lighting jobs, determining "Out-of-date" jobs, and re-rendering these jobs or notifying the lighters about out-of-date jobs.