openGL blur

Member
Posts: 469
Joined: 2002.10
Post: #1
what's the easiest way to do a blur effect in OpenGL?

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 145
Joined: 2002.06
Post: #2
That depends on what kind of a blur effect you're trying to achieve.

To do motion blurs like in Oni you draw the blurred object multiple times in slightly different positions, with a traparent blend mode.

To get light trails like in some flight sims you draw extra polygons on the screen to form the trails. You can also use the trails method on moving sticks (character limbs) to quite good effect.

To get real full screen motion blur you can use accumulation buffers, or render-to-texture.

To get fake full screen motion blur (ala GTA3 and GTA:VC) you use render to texture, and then draw that on top of the previous frame with a slight bit of transparency.

"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat

Bring Alistair Cooke's America to DVD!
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #3
I was looking for more of just a basic blur, like gaussian or radial, not a motion blur. is there any way to use a matrix transorm to do this?

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 145
Joined: 2002.06
Post: #4
Oh, sorry. Most people are interested in motion blur Smile.

For a general blur your best bet is render-to-texture. Render the object once then draw it several times with a mostly transparent blend.

"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat

Bring Alistair Cooke's America to DVD!
Quote this message in a reply
henryj
Unregistered
 
Post: #5
or use glConvolutionFilter2D which enables you to apply arbitrary filter kernals to images.
Quote this message in a reply
Deland
Unregistered
 
Post: #6
Have a look at NeHe's tutorial on Radial Blur & Rendering To A Texture

NeHe tutorial 36

Here's a link to download the Cocoa source code of this tutorial.
here
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #7
the glConvolutionFilter2D sounds like what I need. I looked at the NeHe#36 and they just use texture scaling to fake the blur; not bad, but it gets chunky when you do a big blur.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Tycho
Unregistered
 
Post: #8
I think glConvolutionFilter2D is part of the Imaging Subset, which I don't think is accelerated under any common consumer cards. I could be wrong though.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Gaussian blur g00se 0 2,198 Oct 3, 2011 12:58 PM
Last Post: g00se
  Gaussian blur, software fallback on GMA950 Fenris 11 6,753 Jul 28, 2007 05:00 PM
Last Post: OneSadCookie