setAttr ( "miDefaultOptions.finalGatherMergeFiles", "fgmap.%s.fgmap" % str (frame+ 2 ). setAttr ( "miDefaultOptions.finalGatherMergeFiles", "fgmap.%s.fgmap" % str (frame+ 1 ). setAttr ( "miDefaultOptions.finalGatherMergeFiles", "fgmap.%s.fgmap" % str (frame ). setAttr ( "miDefaultOptions.finalGatherMergeFiles", "fgmap.%s.fgmap" % str (frame- 1 ). setAttr ( "miDefaultOptions.finalGatherFilename", "fgmap.%s.fgmap" % str (frame- 2 ). setAttr ( "miDefaultOptions.finalGatherRebuild", 2 ) # Freeze cmds. setAttr ( "miDefaultOptions.finalGatherFilename", fgmapFile, type= "string" ) def prepareFgFiles ( ):įrame = int ( cmds. setAttr ( "miDefaultOptions.finalGatherRebuild", 1 ) # Rebuild On cmds. zfill ( 4 ) # "" print "Set fgmap file for frame %s -> %s" % (frame, fgmapFile ) cmds. currentTime ( query= True ) )įgmapFile = "fgmap.%s.fgmap" % str (frame ). setAttr ( "miDefaultOptions.finalGatherMergeFiles", "", type= "string" ) def updateFgFiles ( ):įrame = int ( cmds. setAttr ( "miDefaultOptions.finalGatherMergeFiles", "", type= "string" ) cmds. setAttr ( "miDefaultOptions.finalGatherFilename", "", type= "string" ) cmds. cmds as cmds import os def cleanFgParams ( ):Ĭmds. Here is the contents of preframe.py, contents that I will explain, function by function. Of course, there is a little preframe.py in your: maya\scripts. In a "readeable" mode, the two calls are followings: import preframe Ok, that's not really sexy but as you know, Pre render frame MEL and Post render frame MEL only execute. Python ( "import preframe \nreload(preframe) \npreframe.cleanFgParams()" ) Personnally, I use RenderLayers overriding Pre render frame MEL and Post render frame MEL scripts to generate fg map names using the current frame (eg: ) just before render start.įor example, I override the RenderLayer that will be used to generate fg maps with this: python ( "import preframe \nreload(preframe) \npreframe.updateFgFiles()" ) And this is what we will do.Īs we have a range of 101-110 and we will generate two frame before and two frame after, the final Final Gather maps sequence will be 99-112.
To be able to merge Final Gather maps before render (5 maps in our case) you must, as a first step, generate all of them. That said, this effect may go unnoticed on some sequences (especially camera movements), it really depends on what you've got. The ghosting you can have, better than a by frame flicking though, is still unsightly, particularly on renders with few texture/color variations (diffuse surfaces). This approach is far from perfect and you will see it doesn't solve all problems. You can see the scene size mental ray is rendering using the log: Two Final Gather points having a similar normal (I suppose the Normal Tolerance of the Final Gather Quality section is used to control that) and where the distance doesn't execeed the Min Radius of the scene (if set to zero is 10% of the whole scene bouding box) have their color and position merged. In practice, mental ray will merge Final Gather points with similar normal using Min Radius of the scene. Interpolate frames?īasically, the idea is simply to "mix" several Final Gather maps together to mitigate the effect of flicking.įor a frame n, we merge Final Gather maps n-2, n-1, n, n+1, and n+2 (two before, two after). This way will be the foundation to our "temporal interpolation". Well, acutally, there is already a way to give Final Gather maps to Maya to make them merged before render.
#Mental ray for maya 2016 change quality to production how to
How to solve this? fg_copy is your friend! (Specially the -f flag). There is a render of the scene with Final Gather generated for each frame, without interpolation (Mode Automatic):Īs you can see, there is a lot of flicking. Everything is here to have something awful. The Final Gather diffuse bounces number is high to increase visual artectacts.
From the invisible-to-the-camera side: A plane with a white emissive material.I took the typical kind of scene that brings Final Gather to its knees (and most GI caching methods in general): Mental ray actually provide a way to merge Final Gather maps, but Maya integration doesn't do it temporally (no Final Gather map with frame number name). While everything is very simple in Vray, in mental ray, it's a pain (as usual ).īasically you will have to inject scripts in the Pre render frame MEL and Post render frame MEL to recreate the behavior of Vray. Before start, know that it's truly Vray which prompted me to put my nose in mental ray, especially Final Gather map merging.