Dot3 terrain engine

After creating a fast terrain engine that dynamically makes a 10000 triangle level of detail terrain out of a 1024x1024 16 bit height map, I have had some problems texturing it. I eventually came to this tutorial http://www.cs.auckland.ac.nz/~jvan006/mu...titex.html that uses dot3 and 2 texture units for 4 detail textures (one per channel) mixed over a RGB lightmap.

If you didn't change GL_TEXTURE_ENV_MODE for unit0, then it defaults to GL_MODULATE and all of your other setup on that unit is ignored.

Also, be aware that if you specify GL_TEXTUREn as a source, then you're using ARB_texture_env_crossbar which is supported on less hardware than ARB_texture_env_combine. It is exported on Radeon7000+ on 10.3 and Radeon9600+ on 10.2. It won't work on Rage128. It isn't exported on any nvidia card, but it will work as long as you don't specify a texture unit that is unbound or bound to an invalid texture (I verified this in the ADC lab yesterday.)