Game Development Community

Added motion blur....sort of

by Adam Beer · in Torque Game Engine Advanced · 09/22/2007 (4:05 pm) · 27 replies

I have got a simple static 'motion blur' shader working. I tested it with the full screen shaders resource and it worked nicely. Basically I have 2 parameters, MotionBlurStart and MotionBlurLength. The lower the value on MotionBlurLength the less of a blur there is. At 0.1 the blur is minor and at 0.3 the blur is pretty blurry. Any idea on how I could get the game to get the camera's speed and apply the appropriate value for MotionBlurLength based on the speed.

Here is the hosted files in cause anyone wants to have a shot at this.

www.heartofthebattle.com/motionblur.zip
Page«First 1 2 Next»
#21
11/13/2007 (1:28 am)
Hi Matt, did you manage to get a working version of the above?

Regards,
#22
12/27/2007 (11:17 am)
Did this ever get working?
#23
12/27/2007 (9:55 pm)
I have done a bit of motion blur research recently. The technique I chose was described in GPU Gems 3, and I am relatively pleased with the results for the time investment.

The technique is done as a post process, and requires depth information. I chose to get depth information via multiple render targets, because a z-pre-pass was a more invasive change, and since the technique requires dependent texture samples, I think MRTs is a reasonable solution. I added a new aux feature to shadergen to output the depth information to the second render target. The vertex shader should output the screen-space z and w co-ordinates to the pixel shader. In the pixel shader do z/w and output it to the second render target. You can modify the atlas shaders as wel.

I don't want to explain the technique because it's in the book, and I'm not sure that's kosher. The idea, though, is to transform each pixel, in the post process, into world space, then transform that world-space position into the previous frames screen space, to get a per-pixel screen space velocity. It then does multiple samples along the velocity vector.

This works pretty well. I'd like to try using the tex2D( u, v, ddx, ddy ) function with anisotropic filtering to do the multiple samples/averaging by modifying ddx and ddy to take the velocity into account.

One of the problems is that with thin objects, it can sample outside the objects and that causes errors. The other problem with the implementation I did is that it's based only on camera motion. I think the way to go is a velocity texture. I'm on vacation so I don't really want to think too much about it, but that's the plan at least.
#24
01/11/2008 (2:18 am)
Any updates on this resource?
#25
01/18/2008 (10:10 am)
Not as of now. I did contact Matt to see if he did ever get anything working and I am waiting for a responce.
#26
01/23/2008 (7:15 pm)
Pat, so you get the Z information from each object by doing another pass through the procedural shader system?
#27
02/17/2012 (9:59 am)
Hey the link is it still working ? may i study your camera blur vision code?
Page«First 1 2 Next»