Beneath the Water Surface Rendering Techniques?

Started by
3 comments, last by WhirlingDervish 19 years, 4 months ago
Hi! I am trying to make water :) -I have got my nifty little fluid solver that produces very nice water behavior in real time. -I have got some nice reflections to enhance the realism of the surface. - BUT...I don't have refractions :( The last item is why I am writing this. I realize the previous draft of this topic was a bit confusing so I am trying again. I figured out what I was originally looking for...giving the illusion of depth to a flat plane thanks to Alex Vlachos's article! Since his texture map isn't very useful for what I am doing I need to make my own. I immediately thought this could be done by just rendering the stuff below the water surface to a texture and modify the texture coords for refraction. The way I am doing it works great for empty pools but if I want to have a fish or a rock or something in the water you only see the top of it (the object in the water). So I was wondering how people do this? Doing a render to texture at a camera angle different than a straight on bird's eye view doesn't seem to work, unless I am doing something wrong (which is quite possible). Anyone done this before and can give me some pointers? Thanks. Here is what I get with Alex's algorithm: And this is what I get when I try rendering the stuff under the surface to a texture and applying the texture to the water surface: [Edited by - WhirlingDervish on December 14, 2004 5:24:30 PM]
Advertisement
No one knows how this is done?
I suspect you're not receiving any replies because it's hard to be certain exactly what you're asking about. Perhaps you could try to rephrase the question to be more precise?

From what I understand, you're trying to get a 'refraction' (light bending as it enters / exits a more dense medium - ie water, thus distorting what is under the water) effect working in OpenGL. I can't really see a 'refraction' effect in the first pic you posted - it seems more like reflection, with a fresnel effect (increased reflectivity of a surface, the greater the viewing angle differs from the orthogonal). The second picture shows something more like refraction.

Is the effect in the second screenshot what you're after? If so, there are a few tutorials around that may be able to assist you, depending on your desired tech path - specifically, vertex / pixel shaders or not. Again, being specific is good.

In short - the more (on-topic) info you give, the more likely you are to recieve help.

Regards,

Hew T.
check a recent artice here on gamedev by yann
Modified that topic and question, perhaps it makes more sense now.

This topic is closed to new replies.

Advertisement