NonReflectiveWater.rar [7.9Mb] – C# 2.0 (VS.NET 2005)
I had a request from a MMORPG developer to make a lightweight water shader that doesn’t need a reflection rendersurface, yet looks acceptable.
It looks nowhere as shiny as the reflective water shader or even TV’s built-in water, but it runs a zillion times faster because it doesn’t do any parallaxing, nor specular bumpmapping, nor perspective projection… Its implementation is alot simpler as well.
- Two test environments : sunset and day skies
- Uses a L8 (8-bit grayscale luminance) texture for alphablending, which allows semi-transparent shores
- Two lookups of the same normal-map, scrolling in opposite directions, is used to simulate wave animation
- Diffuse bump-mapping is made using the composite normal-map
- A specular/gloss-map defines the specular spots; it’s also bumped by the normal-map
- Two parameterized colors define the darkest and lightest parts of the water
- Supports vertex fog in both SM2.0 and SM3.0 paths (this version does not yet map to TV3D semantics… will be updated soon)