Hello Guest

Basic approach to warpy bendy 2d effects.

  • 1 Replies
  • 6639 Views
Basic approach to warpy bendy 2d effects.
« 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:

Code: [Select]
// 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?

Re: Basic approach to warpy bendy 2d effects.
« Reply #1 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.



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