FX in OpenGL

Started by
11 comments, last by ogl2k 21 years, 4 months ago
Hey, in the NVIDIA demos there is a effect (distort???)that does a sine wave distortion on a 3D object. I think it uses vertex and pixel shaders. You could use small faster amounts of this type of filter at the horizon of a 3D scene to get that far blurred/heat effect. I would look up any thing that has to do with dissplacement and use cloud type shapes for dissplacement factors. I haven''t seen those effects, but am I close to what your talking about?
Take back the internet with the most awsome browser around, FireFox
Advertisement
erm there''s a really neat tutorial on object outlining that you could bastardize for the preadator suit deal...somewhere... i appear to have lost the link for it...sad

as a consolation prize i found an interesting article on gamasutra outlining some simple stencil bufer tricks you can use to get fun effects:
http://www.gamasutra.com/features/20000807/kovach_03.htm

you should look around:
this site in the Articles & Resources section
www.gametutorials.com
gamasutra''s features section

(you may or may not need to register with gamasutra to read their articles. it''s free and you should be a member there anyway b/c it is a wealth of information)

-me

About the Predator-like effect, Hairybudda is on the right track. The idea is applicable to all refractive objects, things like water, glass, lenses, cloaking devices, etc. This is what you do:

* render your scene normally, without the refractive object.

* compute the projected axis aligned bounding rectangle of the refrcative object in screenspace.

* copy the contents of that area to a texture (alternative: dirtectly render those contents into a texture).

* enable automatic mipmap generation on that texture (very important to get neat blurring effects !)

* Now render the refractive object with this texture projectively applied.

* To get the refraction effect, you have two possibilities: either per vertex, this is by evaluating Snell''s law (or an approximation) in a vertex shader for each vertex of the refractive object. To get good results, the object should be reasonably tesselated. Displace the texcoords into the projective texture accordingly.

* Displacing the q coordinate can give you some really weird and cool effects for scifi cloaking, as it will change the compression of the texture. It will make the hardware access different mipmap levels accross each polygon, resulting in a more or less blurred image. The result (make sure trilinear filtering is enabled !) looks like an object with changig refractive index. If you animate that per vertex (Perlin noise), I can guarantee that your jaws will drop to the floor

* Or you do the refraction per pixel. Better quality on low tesselated objects, and takes into account bumpmaps. The principle is similar to hardware EMBM. But it''s obviously slower than per-vertex.

/ Yann

This topic is closed to new replies.

Advertisement