Sign in to follow this  
n00body

Object motion blur, handling previous transform data?

Recommended Posts

When implementing object motion blur, how do you handle the "previous transform" vertices for all your objects? Do you store them, do you recover them? How do you take into account physics state, skinned animation, etc? Any help on this topic would be most appreciated.

Share this post


Link to post
Share on other sites
Perhaps I should clarify. I am asking about how you manage that data for all your visible geometry? Depending on how many static/skinned objects there are on screen, that seems like a lot of data to manage.

Share this post


Link to post
Share on other sites
For any node/ transformed object of your scene, just add another member variable, so you´d have:

-local position, rotation, scale
-orient transform
-local transform
-world transform
.
.
.
-previous world transform

Each frame, you swap the previous transform and the current one (if you use pointers to them).
It is not very hard to do if your engine is well designed.

Share this post


Link to post
Share on other sites
I could see that one, but what do you do about skinned objects? The problem I see is that I want to skin them in the vertex shader. So if I wanted to go that route, I would have to upload the bone matrices for both the current and previous frames. However, that is an awful lot of constant data to be uploading to the GPU every frame for every skinned object.

Share this post


Link to post
Share on other sites
Couldn't you use two separate constant buffers, and just switch between them? That way you wouldn't have to (explicitly) re-upload the skinning matrices for the previous frame; they'd just still be in video memory. (Unless of course they've been evicted, but there's not much you can do about that).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this