Object motion blur, handling previous transform data?
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.
You just store the previous transform(s) from the last frame and compute both the current and previous positions. Get the difference and there's your motion vector.
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.
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.
-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.
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.
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement