Not long ago someone asked me if there was a function in mental ray that could enable a user to compute the final gather solution of the entire scene, from one still camera.
After scratching my head for few minutes, I came up with a solution:
Rendering to texture (0)- This function forces mental ray to compute the FG solution and render each selected object in the entire scene:
1-Open the render setup dialog box and set the fg to its draft default settings.
2-On reuse (FG and GI disk caching) parameters, under final gather map group, set mental ray to incrementally add FG points to map files and set its file name. Note that the, calculate fg/gi and skip final rendering function, is overridden by the, render to texture process, therefore unchecked for this particular exercise.
3-In the scene, select all objects (only) and press 0. The render to texture dialog box should appear. Set its output path. On the objects to bake parameters, under name field, you should see a list of all previously selected objects in the scene.
Scroll down to output name field; click add and select the diffusemap element. Note that, we are only choosing these settings in order to force “render to texture” to render and save the FG solution.
4-On target map slot, choose varies.
5-On map size, choose 512x512, followed by enabling lighting and shadows functions, on selected element unique settings group.
6-On baked material parameters choose the output into source function and Save the Max file (ctrl+s).
7-Set the mental ray’s sampling quality to draft and click render.
8-Choose ok to any of the dialog warnings that may appear. Once the render to texture process is finished, close the Max file without saving.
9- Reopen the Max file; set mental ray to read from the previously saved FG solution and render the scene from a variety of different camera angles at high resolution.
It is worth mentioning that this FG solution may give you slightly different results than the conventional (i.e. normal) FG process. These FG variations are no different to the ones often encountered between Net render and local render, or distributed bucket rendering.
Finally, if the Max file crashes during the FG computation, it is worth re computing the render to texture FG process again(i.e. delete the current FG map and re compute); as FG map file may be corrupt. Also, overwrite any previously saved render to texture files.
Please see below the render results with and without the render to texture FG process:
Alternatively, one could also use the distortion (lume) shader to create a 360 degree FG solution however; the FG solution will be based on the original camera position.
For those not familiar with the above methodology, it is covered in detail in the 2nd edition of our book.
I hope you have found this post useful.
New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max
More tips and Tricks:
Tips & tricks for architectural Visualisation: Part 1
Essential tips & tricks for VRay & mental ray
Creating Customised IES lights