Advertisement

mixing textures.

Started by May 14, 2003 09:08 AM
2 comments, last by paulbird 21 years, 9 months ago
Hiya. Is it possible to mix two textures together in openGL - for example I would like to make a marble effect with a marble texture mixed with an enviroment mapped texture to give it some reflection? Cheers.
Take a look at:

GoldenGlobe
http://nehe.gamedev.net/data/downloads/download.asp?letter=G

Advertisement
Yes! Thats exactly what I''m looking for. I couldn''t quite work out which bit of the code blended the environment mapping with the texture though? Would you be able to post a bit of code?

Thanks.
Ok

one way:

1st gen envmap (sphere map)

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP)
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP)

1. bind base texture
2. draw object
3. bind env map
4. glEnable(GL_TEXTURE_GEN_S)
glEnable(GL_TEXTURE_GEN_T)
5. enable blending and bend mode GL_ONE blah blah ..
6. draw object
7. disable blending
8. glDisable(GL_TEXTURE_GEN_S)
glDisable(GL_TEXTURE_GEN_T)

other ways: mulitextureing, register comine, cube map ,............

This topic is closed to new replies.

Advertisement