Motion Pass

Started by ndeewolfwood, August 10, 2011, 06:43:21 AM

Previous topic - Next topic

ndeewolfwood

Any way to fake a motion vector pass in terragen ? Right ?


Tangled-Universe

You can probably get some blue nodes to compare camera-vectors at different frames and subtract those from each other.
Converting them to a scalar/colour (one of them is not possible, can't remember quickly which) may give you something to work with.
However, how to output it as an image? No idea.

Where do you need it for, motion blur?

Matt

I can't think of any way to do it. The 'get camera position' node will only give you the current state - it's not possible to retrieve the position from a different frame unfortunately.

I'll put motion vectors into the upcoming Render Elements, but that won't surface for another few months.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

#3
Oh, oh... if you don't mind doing a tiny bit of extra work in the compositor, I suppose you could subtract one frame from another in your comp. If the right position values are baked into an image, you could subtract the pixels of frame x from the pixels of frame x+1 in your 2d program and that could give you a motion vector.

Now, the question is what values to bake into the image. Let me go and figure it out, and I'll post some nodes here shortly.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

It looks like there isn't enough info in the Get nodes to be able to do this yet. You'd need to have the camera rotation at least, to be able to get the screen-space projection of the vectors. Theoretically it would still be possible if you already had the camera info in the compositing application.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

ndeewolfwood

#5
I use real smart motion blur to create a motion pass and motion blur shots...it's working like you said with a mix of difference blending between frames and edge detect. It s pretty effective for slow shot but it s going mad with fast move.
I did nt try with cam info and projection but it s good idea i will try when i will come back from vocation.
Thx for info

Tangled-Universe

Quote from: Matt on August 11, 2011, 08:31:51 AM
It looks like there isn't enough info in the Get nodes to be able to do this yet. You'd need to have the camera rotation at least, to be able to get the screen-space projection of the vectors. Theoretically it would still be possible if you already had the camera info in the compositing application.

Matt


I thought the "get ray origin" provided the exact camera vector?

Matt

Martin, if you're asking whether 'get ray origin' would be used instead of 'get camera position', they are very similar, but in this case I thought 'get camera position' was more appropriate because this is purely about the camera, and we don't need to make it work for reflections or other secondary rays. But I think 'get ray origin' would work just as well to allow us to calculate a vector from the camera/ray origin to the surface (you'd still need to do 'get position' minus 'get ray origin'). But neither solve the problem. Neither 'get camera position' nor 'get ray origin' will allow you to account for the rotation of the camera. I could generate vectors between the camera and the surface, and look at the difference between two rendered frames to get a motion vector. But you need to find the motion in screen space, which depends on how the camera is rotated, otherwise your motion blur will be rotated incorrectly.
Just because milk is white doesn't mean that clouds are made of milk.