LWJGL Forum

Programming => OpenGL => Topic started by: Owen Butler on April 16, 2008, 05:45:17

Title: Basic approach to warpy bendy 2d effects.
Post by: Owen Butler on April 16, 2008, 05:45:17
G'day,

I'm looking to implement a bendy warpy like effect over my 2d top down shooter.  It's meant to represent shockwaves from explosions and such.  It's similar in a fashion to the bendy warpy effect you get when you charge up a shot in Metroid Prime 3, if you know that.

I guess it'll look similar to the shots in this post here:

http://lwjgl.org/forum/index.php/topic,1160.0.html

IE:

http://i15.photobucket.com/albums/a363/Funkapotamus/frame2.jpg

Now, I'm wondering about the best way to go about this.

At a high level, my plan is this:

// create gl frame buffer object same size as the screen (640x480) and attach a texture to it
...
// render the scene as normal, but to the framebuffer object/texture (render to texture)
...
// enable a fragment shader which will do the warp effect
...
// disable the framebuffer object, render the whole screen as one big quad, with the texture generated above


Is that the right way to go about this?
Title: Re: Basic approach to warpy bendy 2d effects.
Post by: Owen Butler on April 17, 2008, 08:50:04
Well, this basic approach does seem to work.  After a bit of stuffing around, I have some warpy explosions going on.

(http://shackpics.com/files/Picture2_ffcnmf1dn9knrl8ies2n.png)

I need to tune how they grow and reflect the texture around, but the basics are there.