Wave distortions

Started by elias4444, November 11, 2005, 23:03:08

Previous topic - Next topic

elias4444

Ok, I've been trying to do something like this for a while... I want to take the generated 3D scene and then add a distortion to it (like a rippling effect, or a glass lense effect). Cas, I know you do that in your Super Dudester game somehow whenever you finish a level. How do you do it?

Any help would be greatly appreciated.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Orangy Tang

glCopyTexSubImage will copy a section of the framebuffer into a texture for you. You can then re-render this back to the screen with some kind of deformation applied.

Per-pixel deformation looks rather nice, but unfortunalty you can only do that cross-vendor with GLSL. If you want something that'll work everywhere you'll need to do the distortion per-vertex by tinkering with the texture coords.

darkprophet

if you are refering to the distorsion effect I think your referring to, heres a way to do it:

glCopyTexSubImage to a texture
Load a square grid and set each texture coordinate of that vertex to be its position relative to width/height of grid (i.e., middle = 0.5, 0.5)
Use sin (or cos) waves to move the vertices up/down, giving you that effect. The higher tesselated the grid is, the better the effect.

Simple really :)