Skip to main content
gamedev.net
🔒 Locked

Motion blur

Started by Leo_E_49 Sep 27, 2005 at 7:05 AM 2 replies 1.1k views
Original Post
Leo_E_49
Leo_E_49
I want to have a translucent trail of an object follow behind it, is there any method which works in both Direct3D and OpenGL which achieves this? I know of an accumulation buffer method for this but that's too slow to use in real time.
Tessellator
Tessellator
Hi,

Have a look at this paper which covers motion blur (and cloth simulation):
http://developer.nvidia.com/docs/IO/8230/GDC2003_OpenGLShaderTricks.pdf

It's quite expensive and there are problems with it, but it’s pretty good. I’ve implemented this recently and found it to be ok. Despite it’s title it’s quite applicable to both OpenGL and D3D. You can also look at one of the samples that ships with the DXSDK (PixelMotionBlur), but the results aren’t as good (although the underlying principles seem to be the same at a quick glance).

I was wondering what other people are doing for motion blur and what the current "state of the art" is? The results in Project Offset and Wardevil's RTE1080 are pretty bloody amazing :).

Edit: I should say, if you simply want a trail behind certain objects, such as swords/space ship engines/etc, you can create a simple flat mesh appropriately textured to do the job :).

T
l0calh05t
l0calh05t
yeah, i'd really like to now how project offset's motion blur is done
EvilDecl81
EvilDecl81
Quote:
Original post by Leo_E_49
I want to have a translucent trail of an object follow behind it, is there any method which works in both Direct3D and OpenGL which achieves this? I know of an accumulation buffer method for this but that's too slow to use in real time.


Another trick that works well, but only inside the domain of the texture is to expand the texture gradient in the direction you want it to blur. This is almost free to do.

Looks something like this:

float2 Direction = Pos2.xy/Pos2.w - Pos1.xy/Pos1.w;

float2 derivX = ddx(vTexCoord) + normalize(ddx(vTexCoord)) * abs(Direction.x);
float2 derivY = ddy(vTexCoord) + normalize(ddy(vTexCoord)) * abs(Direction.y);

vColorOut = tex2D(LightMapSampler, vTexCoord, derivX, derivY);


Where Pos1 is the old position and Pos2 is the new position.
EvilDecl81

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.