PDA

View Full Version : Creating a "cloak blur" effect



Crane
11-08-2003, 04:39 PM
I am still relatively inexperienced to OpenGL but this is quite an advanced task...

What would be an effective and efficient way to create a dynamic shimmering/blurring effect caused by, say, a cloaked vessel (seen in a few games) passing over a textured backdrop? The blur should follow the boundaries of the ship so an observant player at close range will see the disturbance.

jwatte
11-08-2003, 08:54 PM
I think this is simplest, assuming you're in fullscreen (so you don't have to worry about overlap, where the framebuffer is undefined):

1) render background
2) glCopyTexSubImage() the background around where the ship is to a rectangular texture (with some margin)
3) render the mesh using the copied texture, and OBJECT_LINEAR texgen set up such that it ALMOST matches the actual projection to frame buffer, and no lighting

The more "ALMOST" gets similar to the frame buffer, the less distortion will be noticed.

Crane
12-25-2003, 01:14 PM
Is their a certain nack to it? Because i have tried glCopyTexImage2D and a glReadPixels + glTexImage2D combination, and all I get is a plain white texture map.

Crane
12-25-2003, 01:16 PM
Although I know that glReadPixels returns the correct data because I saved the buffer to a file and examined it.

jwatte
12-25-2003, 02:43 PM
The only "knack" to it is to make sure all your state is correct; i e correct textures bound; correct TexEnv when applying the texture; etc.

Read the spec, and make sure everything matches up (which becomes complex, because all of the "fragment coloring" path needs to be correct in addition to vertex processing and texturing).

For example, if your texture target has MIP maps turned on, but you only CopyTexSubImage() the first MIP map level, then the others won't be specified, and the result of texturing will be white. Unless you either turn off MIP mapping for that texture object, or turn on auto MIP map generation (if the extension is available).

Crane
12-26-2003, 04:48 AM
Got it - I forgot to set the minifying function to GL_LINEAR.