I just added multitexturing to my terrain engine. I’m new to multitexturing, so I was
a bit surprised by one side-effect that the multitexturing caused: I get weird coloring
on the terrain after I apply the detail texture to it.
Here’s an example: http://saez1.tripod.com/mtex.jpg
This is how the textures are applied:
// base texture glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, baseTexture); // detail texture glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2); glBindTexture(GL_TEXTURE_2D, detailTexture); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glScalef((float)detailscale, (float)detailscale, 1); glMatrixMode(GL_MODELVIEW);
The basetexture is just lightbrown sand, but the multitexturing
(detail texture is just a grayscale bitmap) adds red’ish spots on the terrain as you can
see from the screenshot. Why is that? How can I remove the unwanted side-effect?