Original Post
🔒 Locked
Adding motion blur
Advertisement
Quote:
Original post by fervent
I'm trying to add motion blur to my game (DX9) and I'm looking for a good tutorial or some sample code. I found the one from 2003 in the DX SDK. It's not that great to be honest, so I'm looking for others.
I have found the pixel motion blur sample to be pretty good, so I would stick with that. However, there are also examples of this in the Nvidia SDK. Since the technique is pretty much all in the shaders, there really isn't much to port to managed code.
Generally, velocity-based motion blur is a very simple effect:
- In the VS, transform each vertex by the current WVP matrix, and separately by last frame's WVP matrix.
- Subtract the two, and you have the screen-space velocity of the vertex
- Store this velocity in the alpha channel (if you don't use alpha blending), or in a separate render target (using MRTs - good if you want to do depth of field, too)
- Perform blur passes based on this velocity
This technique works very well for rigid objects, but not so well for skinned (since you would need to store far too many world transforms in the shader).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement