Vivid Experiment - Glass Effect

BlitzMax Forums/BlitzMax Programming/Vivid Experiment - Glass Effect

Armitage 1982(Posted 2010) [#1]
Hi

I was wondering if any of you know how to create such DSD effect:
http://www.youtube.com/watch?v=yQLIJsqkP_s#t=5m23s

At least without any shaders but only from simple OpenGL commands.

In the Light Sequencer Device thread, ImaginaryHuman talk about a precalculated pixel offset that warp any pixel behind that glass effect except you would need some kind of Render Target (and I didn't find anything valuable about RTT right now).

Already done something similar ?


ImaginaryHuman(Posted 2010) [#2]
I looked into this for quite a while because at one point I wanted to do a real simple bumpmapping technique, whereby if you could simple precalculate the texture coordinate offset in one texture you would be able to displace another to make it look like it was bumpy, which is basically what this effect does.

There was a very short term ARB extension years ago which would do it but it was never widely adopted. You can use normal mapping but that means a) you need a normal-map texture calculated, and b) you need a shader in order to pull in normals from the texture and divert the light calculations.

Another possibility is to use a very dense mesh with very small triangles and pass in `normals`, then use cube mapping to look up a texture.


Armitage 1982(Posted 2010) [#3]
Yeah a bit like this : http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=272755

But as you said it's using a normal-map and shader :s

The mesh idea should work too but it's way too much polygons for such effect.

I think a texture with level of grey should do the work for the coordinates offset but the pixmap fast/write part is probably too slow in order to use it in real time games.


Armitage 1982(Posted 2010) [#4]
A BlitzMax example from Taron using FBO is available here and working great : http://blitzmax.com/Community/posts.php?topic=88944#1009929

But FBO won't work with old CG and I won't be able to use it because I'm generally using Graphics() rather than GLGraphics() (to say it simply).