Two textures on one face

I’m rendering a series of triangle strips, along each strip I have a texture which is streched accross the entire strip.

This is for a terrain engine and while it looks good zoomed out once you get in close its quite bland.

Therefore I want to render a second texture ontop of the large one for every four vertices.

Something like Ground Control or Black and White where when you get close to the terrain you can see a tiled texture of cracks or something across the terrain on top of the overall texture.

Can anyone help?

Thanks in advance

You’ll need two sets of texture uv coordinates. Either multipass it or multitexture it.

Hope that helps.

You don’t necessary need two sets of texture coordinates, if you use two different texture matrices.

Implementation wise, either activate the second texture unit and bind the second texture, or render the strip twice; once with the base texture, and once with GL_MODULATE mode.

You might want your detail texture to use a custom MIP map which fades it out (0 alpha) after one or two levels to avoid a dirty look in the distance (I think black & white does this, too)

I don’t really like the idea of rendering twice as this would have a big preformance hit but I don’t quite get what you meant when you say “activate the second texture unit and bind the second texture”. How do #I do this?

Thanks though for your suggestion on the MIP maps, I had been wondering how to do this and I’ll try that method (when I get it working at all)

Any suggestion for the other problem?
Thanks again.

Multitexturing (multiple texture units) are available in OpenGL 1.2, but also available as an extension in 1.1. Read up on ARB_multitexture, or check it out in the 1.2 documentation available on this web site.