Bombinaid 

      Login / Register  Bombinaid.com Home  INDEX
 
 









   Simple Motion Blur [Very Easy] (OpenGL)
Admin
Page Options:

Printable Page

3183 Views

Hello and thanks for viewing this tutorial. F.Y.I This tutorial can be used on ANY project you have. For instance like my game engine project isn't that clean upped like Marek has he's, but its very easy to figure out! :D


Motion Blur?
Right now you mite be thinking on motion blur for stuff like this for example:


The answer is YES sort of. This wont work that well if you wanted to create a racing game or wanted to add bloom effect of the front view of the scene and not blur your players 1st person model. (Gun, Hands, etc)

This is more like general you wanted to give that wasted effect or a memory cut scene or so, its up to you!

Any ways enough of the Introduction Lets Code!

In RenderPost func OR near SwapBuffers add this up top of glFlush()


float q = .60;
glAccum(GL_MULT, q);
glAccum(GL_ACCUM, 1-q);
glAccum(GL_RETURN, 1.0);


Note: The higher the value in float q the more blurry the scene will be!

If you want the sort of blurry effect leave it .60, for a really blurry view pick .90.

Under Resize Function

Now when you created your window resizing function for OpenGL add this before glMatrixMode(GL_MODELVIEW).


glClearAccum(0.0, 0.0, 0.0, 1.0);
glClear(GL_ACCUM_BUFFER_BIT);


These will insure when you resizing your window you will get the guarantee of a good motion blur on your window!

I hope you enjoined this tutorial!

Email: = "cyberdemonimp@yahoo.com" (With Out Quotes)




8 + 14 = characters left