Skip to main content
GameDev.net gamedev.net
🔒 Locked

water reflection question

Started by butthead_82 Feb 22, 2009 at 6:22 PM 3 replies 1.2k views
Original Post
butthead_82
butthead_82
Hi everyone, I implemented some water effects (just reflection and refraction) and now I'd like to do add some waves to my geometry but my reflection is planar. How is reflection done if water surface is not flat? And can you please recommend some method for rendering waves for game engine? Thanks for help
Cineska
Cineska
Ripples are done in the pixel shader via a normal map.

Here you can find all what you need:
http://www.riemers.net/eng/Tutorials/XNA/Csharp/series4.php

butthead_82
butthead_82
Thanks for reply. That's a great site you suggested. Actually I already implemented ripples via normal mapping(forgot to mention that).

It looks nice, but what I want to do now is add some "real" waves by displacing geometry. I heard for some methods for achieving like FFT and sum of sines but I would need a hint on which one is the best for games.

Also, how should I implement reflection in that case(planar one obviously wouldn't work on non flat surface)?

[Edited by - butthead_82 on February 23, 2009 11:51:31 AM]
Cineska
Cineska
FFT is used in some commercial titles. (Crysis and Age of conan I think)

If you get FFT ready the reflection is no problem anymore. You need to calculate the normal in the vertex shader and with this you can get the reflection. For the reflection render target I used the same as in planar. I had no need for cubic reflection but my waves weren't that high. Even when they are high you can "cheat" a little bit with a normal map to displace it further or just ignore everything that is reflected behind you and just use the sky.

Another method would be via some layers of perlin noise. The results are very nice even with just 2 perlin noises but it was a little slow in my implementation.
butthead_82
butthead_82
What's your opinion about that texture displacement from GPU Gems 2?
http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter18.html

I took a look on that, it seems to provide fine results with relatively small computational price.

But I don't quite understand radial coordinate LOD system. And even more frustrating is that I cannot find it explained anywhere.

Know about some sources on this?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.