Radioactive-Software Radioactive-Software
Forum to discuss Radioactive-Software Products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Questions about PixelMotionBlur

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Derek
Guest





PostPosted: Sun Apr 08, 2007 12:28 am    Post subject: Questions about PixelMotionBlur Reply with quote

Hello I've been implementing pixel motion blur into my own game engine using the velocity buffers technique shown in the DirectX SDK sample code.

However I've found a problem that when triangles that are visible and also have some vertices behind the viepoint then it causes really bad skewing effect in the post process blur. I've found a workaround by putting vleocity calculation code in the pixel shader at the expense of performance.

I was wondering is there something that you do in your vertex shader to get around this or are you meshes tessellated enough such that you don't often have large triangles close to the viewpoint?
Back to top
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Sun Apr 08, 2007 12:14 pm    Post subject: Reply with quote

I know what you're talking about with the artifacts near the viewer using the D3D sample. I also had to add some extra checks into the vertex shader....combined with the 12 samples per direction it gets slow real fast. Yes tessellating your geometry is one fix, but I'm actually working on a new shader [combined depth of field / motion blur / bloom] all in one shader and I'm writing it from scratch, though I use the velocity buffer technique...

It doesn't seem to have those issues as the D3D sample though I'm still working on it...basically do 2 transforms in your vertex shader [current and previous WVP], take the abs[cur.x-last.x] [abs[cur.y-last.y] * Scale factor, etc. inside the vertex shader...and in the pixel shader do for(i = -4; i <= 4; i++) and add up the samples, and divide by 9 at the end of it...also I'm doing this into a 256x256 texture, and I'm also burring the velocity buffer before using it. It's faster, and it doesn't seem to have those artifacts....once I get it working I'll probably post the code. I can't verify that it works perfectly right now though I'll hafta go back and look at the D3D sample to see exactly what is different, I remember they were doing some other velocity/magnitude calculations etc...

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Mon Apr 09, 2007 2:10 am    Post subject: Reply with quote

Ohh yea, also scale the blur based on the distance from the camera that's one other thing I added...
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group