Water colour using a cube map

I refer to the Gamasutra article on Deep Water Rendering: http://www.gamasutra.com/gdce/jensen/jensen_01.htm

In the section entitled “Color of Water”, the author talks about indexing into a cube map to find the colour.
Has anyone had any thoughts on how to do this with texture shaders? As far as I can see, you can only do the “cube map reflect” calculation with texture shaders, but no “cube map refract”, or something similar.
Maybe someone could share their implementation ideas on this area…

At that point he was talking about the reflection term only, which should be in world space here. He goes on to weight this vs the refraction using Fresnel’s term and it’s the color of refraction he also cube maps.

He clearly says he computes the refracted ray using Snell’s Law, that is all you need for the refraction cubemap.

This is simply a cube map for all possible refraction directions that might come out of the above. It’s generated for a homogeneous water material with a flat surface. The refraction vector is then used to access this cube map, with the usual EMBM vector peturbation mentioned later in the article.


NVIDIA has reflection and refraction EMBM demo on their web site, the refraction mode even has a 3 pass chromatic aberration effect.

Thanks dorbie, I’ll look into that.