by decade » Thu Apr 20, 2023 9:43 am
decade
Thu Apr 20, 2023 9:43 am
I am in a position of desperately needing an object position pass to finish a project.
Until now, I have been using Redshift to produce the object position pass - but for a couple of shots we need to use real in-camera motion blur, so I need it to come out of Octane directly.
I tried camera projecting the Redshift position pass render onto my geometry in a global texture AOV - but it doesn't respond correctly to motion blur.
I also tried the OSL shader approach mentioned earlier, my code looks like this:
shader objectPosition(
point Vector = P,
point ObjVector = transform("common", "object", Vector),
output color Col_Out = color(0)
)
{
float x = ObjVector[0];
float y = ObjVector[1];
float z = ObjVector[2];
float colX = 0;
float colY = 0;
float colZ = 0;
if (x>0)
colX = 1;
if (y>0)
colY = 1;
if (z>0)
colZ = 1;
Col_Out = color(colX,colY,colZ);
}
If I use Vector P directly, I get some results, but not the world space I would expect - instead, X & Y seem more like in some kind of UV space & z is always constant blue.
As soon as I use the transform command to try to convert it to object space, the result is just black on every axis.
If anyone has any idea how to get an object position pass out of Octane I'd be very grateful.