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?
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?
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]);
}
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