new shaders shipped with Maya/Max 2008


Oops sorry it’s called “result_fb”. Mea Culpa :wink:

  1. Create a mental ray user buffer (from render globals)
  2. Create a mental ray output pass (from camera)
  3. Set output pass to “file” and “from user buffer”, pick your user buffer
  4. Set mip_motion_vector to output to buffer “0” (= the first user buffer)

See this file



that will help a bit i guess…
but can you please take a look what my error might be?
like that:

i get 2 images rendered, but both are the identical beauty images.

sorry for bringing such trivial questions to this techy thread :slight_smile:




See my (edited) prev. message!

Did you miss step #3? In the output pass, you have to tell it to output the user buffer… otehrwise it just outputs the main buffer again…



hehe… just saw the first line before your edit :slight_smile:

geez i was really close and already guessed the FBs start with zero.

thanx for helping me with that one. i appreciate that a lot.

yep i missed step 2, since adding the FB in the camera already gave me 2 images.

cheers & keep up the great work



hey MasterZap,

just have to thank u so much for the example files and the explanations.

Been trying for so long to get my head around the framebuffers wich no success, but i feel i’m a lil way closer to grasping them after your posts!

cheers man!


Set mip_motion_vector to output to buffer “0”

Zap, is it possible to do something like this with other shaders, particularly mia_material_x?

I have had partial success with ctrl.buffers, but it always gets pretty messy.



Yeah, well, Maya has this odd behaviour of moving the time for motion blur renders… I don’t quite get that…

  ...anway, the point is that you are "supposed" (i.e. the idea is) to create your motion vectors is [i]the same render pass[/i] as your beauty. And use the "blur_fb" to write it to a separate one. Then you will have them in sync, guaranteed.
  But your point is quite correct. Why is maya changing the time for motion blur renders? To match some maya software rendered blur, or ... (?)

I think i have figured it out. The custom motion offset parameter seems to be buggy. Essentially when its off it should not pass any offset value what so ever, but that doesnt seems to be the case, its still passing an offset of .5 though it has been greyed out which is why your getting a frame shift. Turning the offset on and putting an offset of 0, exactly alligns the mip_motion vector with a non motion blurred frame. You can essentially turn off offset after that and have a check, it will still be alligned cause that 0 value is still being passed. BUG. :slight_smile:


hi zap
i’ve one more question about the mip_card_opacity, how it work?
because when i set the opacity to 1, the scene is rendered with no error, but no alpha generated!
if i set the opacity to 0 in mip_card_opacity mental ray stop to finalise the image and stay generating
a Loop warning error in Outpout Window and stay like taht until i hit the Esc button
PHEN 0.3 error 051071: broke suspected infinite trace recursion
PHEN 0.5 error 051071: broke suspected infinite trace recursion
here with opacity set to 1 only color no alpha generated (pure white image)
here with opacity set to 0
and here is the alpha
so how to fix that ?!


Hey all. I’m totally new to this side of mental ray, but I’m trying desperately to get the mip_motion_vector to work so I can output files that Real Smart Motion Blur can understand (in After Effects). Can anyone please write a quite step by step for a semi newbie user? I’m trying this route because I can’t seem to get lm_2DMV to work with maya2008 on my quad g5. :frowning:

Thanks for all your help!


zap has posted 02 examples for motionblur and vector blur
look here



zap has posted 02 examples for motioblur and vector blur
lokk here


edit: if you have a source code for lm_2DMV shader i can compil it for Maya2008


Works fine here…

Sounds like you are connecting it wrong.

You would use something like:

mip_matteshadow.result => mip_card_opacity.input
mip_card_opacity => miMaterialShader of your shading group



If I recall corectly, pretty much the default settings should output what “Real Smart Motion Blur” wants, you just have to match up the “max displace” value with the similar value in ReelSmart, so look at the two examples I posted.

In After Effects, you add the motion vectors pass as a separate (hidden) layer an reffer to that in the “RSMB Vectors” plugin. I tried it w. version 3.0 and it works fine.



Yes the connection was wrong! i’ve replaced the “mib_color_alpha” with “mip_card_opacity”
now it work fine
thanks zap for your help


we have combustion and toxik at work (along with other Autodesk products like flame and such) , anyone know how to use these motion vectors with them… I think I’m missing something!

I might be asking in the wrong thread

Thanks in advanced


Doubt that; floating point format “2” is specifically the “Toxik compatible” version.



Hum so you say that it should work with toxik
? no need for plugins…
sorry but I was told I need a pluing like “ReelSmart”
(it’s not free)

And I have to make the decision for the company.


Well if it’s the company money , then go for it why not!


I am not a Toxik expert in any way, shape or form, and have actually never run the product myself, so I really don’t know what is included in the “Base package” or not.

I know that the format output in this mode from mip_motionvector is the format Toxik “expects”, and I know that I generated a demo of my “dancing hulk” thing which was used as a demo of some form of “Toxik re-timing-based-on-motion-vector feature” already some year ago. So I know the format is “correct”, but I have no idea how you would actually use it in Toxik, or what you can do with it in Toxik once it’s there.

It may be like in AfterEffects, yes, there is a motion vector “format” it understands but the base AE (from what I know, was a few years since I used it) doesn’t actually include a motion blur shader per se.

So to make a long story short… I have no idea :wink:


// Internal MentalRay Nodes. Not meant to be used with Maya.
if ($nodeType == "misss_physical_phen" ||		 
	 $nodeType == "mip_card_opacity" ||			 
	 $nodeType == "mip_matteshadow" ||		 
	 $nodeType == "mip_matteshadow_mtl" ||
	 $nodeType == "surfaceSampler")
return "rendernode/mentalray/material";
if ($nodeType == "mip_rayswitch" ||			 
	 $nodeType == "mip_rayswitch_advanced" ||	
	 $nodeType == "mip_cameramap" ||	
	 $nodeType == "mip_mirrorball" || 
	 $nodeType == "mip_grayball")
return "rendernode/mentalray/texture";
if ($nodeType == "mip_rayswitch_environment")
return "rendernode/mentalray/environment";
if ($nodeType == "mip_motionblur" ||
	 $nodeType == "mip_motion_vector")
return "rendernode/mentalray/output";
if ($nodeType == "mip_gamma_gain" ||
	 $nodeType == "mip_render_subset")
return "rendernode/mentalray/lens";
return "";

Oddly enough this doesn’t work for me. I get a bunch of delightful errors:

// Error: (Mayatomr.Nodes) : Shader declaration “mip_rayswitch” has not been loaded - node type ignored. //

// Error: (Mayatomr.Nodes) : Shader declaration “mip_rayswitch_advanced” has not been loaded - node type ignored. //

// Error: (Mayatomr.Nodes) : Shader declaration “mip_rayswitch_environment” has not been loaded - node type ignored. //

// Error: (Mayatomr.Nodes) : Shader declaration “mip_card_opacity” has not been loaded - node type ignored. //

// Error: (Mayatomr.Nodes) : Shader declaration “mip_motionblur” has not been loaded - node type ignored. //

Whaaaat am I missing? I removed the extra return “”; in the script because they were redundant apparently. I received more errors when the script ran.