Sign in to follow this  
  • entries
    162
  • comments
    262
  • views
    167081

Screen-space distortion magic

Sign in to follow this  
OrangyTang

502 views

Screen-space distortion effects have become more common recently, particularly for funky water and heat haze effects. A few months ago I had a crack at doing this but hit a couple of snags:

- You need a dependant texture read, which in OpenGL can only be done in a vendor-independant manner with GLSL.
- There isn't a 'signed add' blend mode so you have to perform multiple distortions in seperate passes.

Well I went back to it to give it another shot, the first point is pretty much unavoidable (although it does become less with time) however by packing values into textures in different ways and adding an extra pass I can now compose an arbitrary number of distortions together before applying this to the scene.

Composed ditortions (note overlapping noise and the large swirly distortion):


Final distorted image:


The effect isn't really as good looking in static screenshots, you really need to see it moving to appreciate how the lines and objects get warped around the screen. :)

I'm considering writing a short series of articles on 'crazy 2d effects', essencially abusing current 3d hardware for cool effects suitable for 2d games. I dunno whether there's enough demand though, I doubt I could cover anything really new, yet there is so little on 2d graphics other than ages old tilemap type stuff.
Sign in to follow this  


2 Comments


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now