Vector shader downloads and information
mental ray plugin in Maya
First: download the Maya files from Horvatth Szabolcs' site here. Of particular interest in the .zip package is the .mi file and the .mel template. For the shaders themselves (the .so files) follow the instructions listed here:
- Windows (32 and 64 bit): Download the mental ray vector shader, provided by La Maison. The docs on the La Maison mental ray shader page talk about Softimage|XSI, but simply download the shader and follow the directions below in the Recommended Settings for Maya" section below.
- Linux 32 bit: Download the mental ray vector shader, provided by La Maison. The docs on the La Maison mental ray shader page talk about Softimage|XSI, but simply download the shader and follow the directions below in the "Recommended Settings for Maya" section below.
- Linux 64 bit: Download the compiled mental ray shader .so file from Haarm-Pieter Duiker's site here. From the author: Fedora Core 7 was used to compile the Linux 64-bit shader. This may cause some problem for people running mental ray on other platforms. The makefile is there next to the source if it there is a problem.
Note: this download only includes the .so files for various OS's, so you still need to download the .mi and .mel files from this site.
- Mac OS 32 bit: Download the shader, .mi and .mel files needed, plus instructions for installation from Evil Eye Pictures free download here.
- Other OSs, or problems with shaders provided. Download source and makefiles from Haarm-Pieter Duiker's site here. The makefiles provided should allow you to modify them for your particular situation.
Turtle For MayaTurtle for Maya from Illuminate Labs now has support to render Motion Vectors which conforms to our Motion Vectors documentation. Tests and Documentation in preparation.
AIR for Maya (via MayaMan)
AIR from SiTex Graphics has a motion vector pass option. We have not tested it ourselves, but clients report that their motion vector pass works with our plugins that use motion vectors as intput.
Recommended Settings for MayaThis FAQ was produced with the help of Horvatth Szabolcs; the information he originally posted can be found here.
These settings have only been tested witht the La Maison vector shader and not the unsupported mip_motion_vector shader by Mental Images.
In Maya you can save all this as a reusable Render Setting so don't feel overwhelmed by the level of things that can be changed.
Shutter Angle: It is recommended you use a shutter angle value of 180 degree in Maya. The shutter value in Maya (unlike the other controls mentioned here) is in the Camera settings (under effects). Note: It is important to understand that Maya scales motion vectors based on that value. It defaults to 144 in Maya. The net effect is a tool like RSMB Blur Amount for example is internally scaled to a full Motion Vector Length meaning 360 degree so Amount of 0.5 means 180 degree. As people have reported some issues with setting shutter to 360 degrees in Maya, then you can consider setting the shutter angle to 180 but then you have to compensate somewhere by a factor of 2, either the relationship of the shader Normalize param and our plugins MaxDisplace value OR in the case of RSMB by setting the amount to 1.0 instead of 0.5 as below. Furthermore in the Mental Ray Render Settings, the "Motion Blur Calculation" parameter scales that as well.
Quick Install Recap: (trust Horvatth's page quoted above more then us for that).
- Download the Maya files from Horvatth's page Maya Files (zip file also includes an icon for HyperShade) and Copy the lm_2DMV.mi file to the `mayaX.0/mentalray/include` directory.
- As well, copy the AElm_2DMVTemplate.mel file to a maya script directory
- Copy the DLL (or .so) to the `mayaX.0/mentalray/lib` directory.
- Add the following lines after similar declarations in the maya.rayrc file. The rayrc file is in the MayaX.0/mentalray directory in Maya X.0.
- for Windows:
link "{MAYABASE}/lib/lm_2DMV.dll"
mi "{MAYABASE}/include/lm_2DMV.mi"
- for Linux and Mac:
link "{MAYABASE}/lib/lm_2DMV.so"
mi "{MAYABASE}/include/lm_2DMV.mi"
- for Mac only:
if you are not familiar with such installation, you access this by right click to show package content.
Do not rename an installed Maya (eg maya7dot1) as you risk breaking links to shaders
-
The lines added to maya.rayrc initializes the shader for Mental Ray. If they do not exist then the shader will only in Maya, but not in Mental Ray, and the following error messages will appear in the output window:
API 0.0 error 301031: call to undeclared function "lm_2DMV"
API 0.0 error 301036: undefined shader "lm_2DMV1"
-
The shader will appear in MentalRay Materials.
lm_2DMV appears in the HyperShade at the `Create mental ray Nodes/Materials` tab.
(If you don't have this tab then create an environmental variable called MAYA_MRFM_SHOW_CUSTOM_SHADERS set it to 1 and restart Maya. It will enable the display of Mental Ray nodes.)
Important Notes
You should refer to this FAQ for Mental Ray Shader settings
How La Maison's Mental Ray plugin works with RE:Vision Effects plugins
Much like Guy explains for the use of the shader within XSI on the La Maison site, make sure that the Maya is rendering with motion blur on, but with the shutter effectively zeroed. For such, we recommand to set "shutter" and "shutter Delay" values to be both 0.5, 0.5 OR the smallest value you dare to type e.g. 0.000001.Both of these values will ensure that you do not motion blur the motion vectors themselves if they are set to the same value.
There seems to be an issue matching MB off and MB "exact deformation" with shutter of 0.5 0.5 in Maya. Thus one cannot apparently simply take the alpha of the beauty pass and make it in post the alpha of the MV pass without creating artifacts. It's been recommanded to us to set your whole pipeline to always work at 0.5 shutter delay in Maya so a beauty pass without MB, an MV pass and a 3D MB passes all matches as best can be. Some rudimentary tests seem to indicate no real effect on rendering speed (MB off vs MB 0.5 0.5). Alternatively if you don't mix and match 2D and 3D motion blur, you can work at a real tiny value like 0.000001 for the MV pass and MB off (you would be at worst in a 1000 image res pass, 1000/1000000 (or 1/1000) pixel off). Maya UI won't show values below 0.001 but will pass them correctly to the renderer. Furthermore if one forgets and leave at 0.000 by copying without seeing, then they will get flat zero motion so it will be obvious.
To get an alpha from the shader, one has to check in Custom Entities in the Render Settings the "Pass Current Alpha Channel" option. Do not try to use the beauty pass alpha in Maya. It won't perfectly align.
The samples values (Anti-Aliasing in Render Settings) will have an effect on your result, the minimal setting (which is minimal anti-aliasing) would be (min0/max0, filter : triangle 1/1). You might prefer a bit of anti-aliasing, particularly for warping tasks (as opposed to blurring ones) as on some odd shapes you could otherwise create small artifacts.
It is not possible in Maya to set shutter to 0.0 0.0 as Maya in that case does not set "-motion on" thus motion vectors are not passed to the shader.
If working on a MAC, you must first apply a surface shader to the object you want to render with the lm2dmv shader then in the surface shader color channel link it to the lm2dmv node and it will work both in the render view and in batch... otherwise on the mac batch loses connection to the shader somehow. On Windows, both will work if you just drop the node on the object.
Optimization
When rendering the Motion Vectors pass a number of things can be turned off to speed up that pass. For example, lights can be hidden as they have no impact. We were told that turning off raytracing and setting time contrast to 1 1 1 1 could speed up that pass render as well, but have not extensively tested and presume that perhaps it would come into play only if shutter and shutter delay are not set to same value. We have not been able to find any use for the Custom Motion Offsets in the Mental Ray Render Settings of Maya.