[solved] Animated Normal Map (tiled)

Hi All,

I’m a student just getting to grips with the Unity engine for my course.

I’ve attempted to create a nice water texture out of an animated normal map and I’m nearly there. I used the ‘Animated Tile Texture’ script and swapped out the ‘_MainTex’ with a ‘_BumpMap’.

The only dilemma I face is that I can’t seem to be able to tile this any larger than 1x1. Am I missing something… and if not is the script easily amendable to accommodate tiling?

Many thanks.

p.s. a demo 10x10 water normal map can be found here for testing: http://www.graphicall.org/yofrankie/game/textures/water_nor.png

Hi, welcome to the forum!

The animated tile texture relies on extracting a portion of the main texture using the offset and scale values. This effectively stops you tiling the texture as a repeat pattern over a large object. Perhaps you could create a large plane object for your water in a 3D app and set the UVs so that the texture repeats several times over the plane?

I figured this out in the end. You can view my result here:

http://www.henryhoffman.com/games/water.html

Script I used:

var frames : Texture2D[];
var framesPerSecond = 10.0;

function Update () {
    var index : int = Time.time * framesPerSecond;
    index = index % frames.Length;
	renderer.material.SetTexture("_BumpMap", frames[index]); 
}

More info on generating the normal maps with Blender: http://vimeo.com/2685288

Hope this helps someone else :slight_smile:

Its helped me, thanks!

Quite a waste of memory and the effect is trembling, not that great… much better mix 2 moving normal maps by 50%… if you can work with shaders of course :smile: :smile: :smile: