displacement mapping?

hello, i try to create some water effects and
i dont know how to start with shaders.

in flash8pro for websites i got the displacment mapping to creating cool water effects
and i search for a way to bring it to opengl/jogl.

i got an FBO that is filled with the mirrow image and at moment its
a flat water in the landscape with that mirror fbo texture. (looks ok,but boring)
now i want to bring some life in it.

my idea is to access the fbo texture and add some perlin noise/displacement mapping
to get the water wave effect like in all games.

did anybody got an idea on what can i do?

greetings theri

OpenGL currently can only displace vertices, so if you have a sea of only a few triangles, it’s hard to do any real displacement. But if you tessellate your geometry, you can have use your vertex shader and a texture lookup or a procedural function like Perlin noise to displace the vertex before going to the fragment shader. If you handle the normal in the vertex shader, most of the fragment shader is just the texture lookup.

If you want a good example, you can track down the code for Java Monkey Engine’s water demo. Click on ‘run demo’ for the water demo below if that’s what you’re interested in doing.

http://www.jmonkeyengine.com/movies_demos.php

The term you’re looking for is parallax mapping and the technique can be performed in the fragment shader on cards going all the way back to the Radeon 9700.

You don’t need parallax mapping for this. You could try this tutorial: http://www.bonzaisoftware.com/water_tut.html or google for opengl water shader.