Renderman lm2DMV shader


#1

I’m trying to do a render pass that works with smart reel plugin for motion blur passes.
I have :

surface
 MV(float Threshold = 1;string TargetSpace = "NDC"; string useZ = "yes")
 {
 
 //start and end 
 point bS = P + dPdtime;
 point bE = P + (dtime * dPdtime);
 
 //velocity
 vector M = transform( TargetSpace, (normalize(bE - bS)));
 
 Oi = Os;
 //outputing
 setcomp(Ci,0, (xcomp(M)/Threshold+1)*0.5);
 setcomp(Ci,1, (1-ycomp(M)/Threshold)*0.5);
 setcomp(Ci,2, 0);
 
 
 }

But its not working, with mantra they us a function blurP but PRman doesnt have it.

any suggestions?

thanks in advance,
Alexis


#2

hi alexis,

actually dPdtime is a vector which descripes the change of P. so i don’t really know what the reel smart plugin needs as input but mostly this is the motion vector and this would be dPdtime.

doesn’t something like this work?


 surface outputMotionVectors(output color motionVector)
 {
 		motionVector = dPdtime;
 		Ci = motionVector;
 		Oi = Os;
 }
 

//EDIT -> yes sorry you should transform the vector to screen space

i’m defining motionVector as an AOV. like this you can render that with your other aovs (for example by porting this code to be an athmosphere shader)

grs
Patrik


#3

Hm,you might also just add dPdtime as an additional output,i mean whithought assigning that kind of shader…but make sure that motion blur is activated.


#4

alex, wouldn’t you in this case don’t have the values in screen space? isn’t that what is needed for motion blur in compositing?


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.