Basic approach to warpy bendy 2d effects.

Started by Owen Butler, April 16, 2008, 05:45:17

Previous topic - Next topic

Owen Butler

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?

Owen Butler

Well, this basic approach does seem to work.  After a bit of stuffing around, I have some warpy explosions going on.



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