Skip to main content
gamedev.net
🔒 Locked

Motion Blur problem

Started by programci_84 0 replies 750+ views
Original Post
programci_84
programci_84
Hi, I've looked at GPU Gems 3 and DirectX PixelMotionBlur sample. In the second, they store last frame and current frame, then pass'em to the shader. In the first, they use a depth texture then extract the coordinates and use etc. I'm inspired by these and now trying to implement motion blur effect but I have two problems: 1-) I've tried the technique used in DX sample, it's so complex. I declared a class called C2DRenderTarget() and with this, I can simply use render targets now. I'm using several render targets (one for phong shading, one for depth of field, one for showing final result via a Full-screen quad etc.). I also declared two textures: texCurr and texLast. Before D3DDevice->BeginScene() method, I'm passing Final result texture (which will be rendered to FSQ) to texCurr. Then before D3DDevice->Present() method, I'm passing the texCurr to texLast. In this way, I think I'm now storing the current and the last frames. But I made some tests then saw that texLast is always equal to texCurr. I've tried it for two integer values and saw no problem; but why with textures? 2-) Once I failed in DX's technique, I started the technique in GPU Gems 3. I prepared a C2DRenderTarget to Device's level-1 render target (A16B16G16R16F). I'm writing .z value to red, a blur value (calculated for Depth of Field) to green and .z/.w value to blue. I'm using this texture both in DoF shader and Motion Blur shader. No problem for DoF, it greatly works. But I can't say the same for Motion Blur. Before Device->BeginScene() method, I'm storing current View * Projection matrix and passing it to the shader in the next frame. Also, I'm passing the texture that I also passed to DoF shader, I'm using it's .b value. There's a blur but too bad. I moved the camera a little and got a screenshot. Click to view What I'm doing wrong? Or any suggestions? Thank you for your patience. Regards.
There's no "hard", and "the impossible" takes just a little time.

Topic Locked

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

Sign in to reply to this topic.