Water demo

This is a demo showing a strange technique that I sort of invented myself.

It works by making a animated normal map with two hoaxed normal maps (one is just a upside-down version of the other). These normal map have been changed by simply reducing the brightness.

A buffer is created that draws a square where those 2 normal(-ish) maps are scrolled and multiplied, the output of this buffer is then used as a normal map to simulate a animated surface.

In this demo I didn’t use real reflections just a image with some clouds.

Download link:
[updated link]

This actually looks not bad at all :slight_smile:

Thanks for sharing

Now that I think of it 2 normal-ish maps are not needed. Take the same image and rotate it 180 deg in code and you’ve got one less file to ship.

The other good thing about this is that you don’t need custom shaders and it’s about 2x faster then a animated texture with a SequenceNode on my PC.

Oh, and if anybody wants to run it with 1.7 or lower, then the texture mode for the normal map must be set to ‘normal’, I used ‘normal_gloss’ just to make it shiny without an extra map or materials.

An updated version:

The concept is the same, just the code has been moved to a separate file.

Just import the WaterAnimator class and call
WaterAnimator(waterNode, textureStage, texScale, scrollTime, bufferSize)
waterNode is the water model (NodePath)
textureStage is the name of the normal map texture stage - maybe the name was a poor choice (string)
texScale - well just a texture scale (default 1)
scrollTime -the time it take to scroll the UVs, the lower the number the faster the movment (default 6)
bufferSize - size of the buffer (default 512)

I’m no good making up API that make sense, sorry.

Oh, and its free to use, WTFPL license, but I wouldn’t mind if I got a bit of credit anyway :wink:

The download link is broken and I want to use it in my program. Please reupload!

I don’t think I have it anymore and looking back I don’t think it was much good anyway :wink:

I cant download the file! Please fix it!

Maybe this was an acceptable idea back in 2012, but not today, really. It’s just a normal map sampled twice and scrolled in opposite directions at different rates.

Maybe it inspires you. Form a ThinMatrix youtube tutorial.

There are a lot of panda shaders here.