PDA

View Full Version : Mixing/adding multiple textures to one object



int0xicated
06-15-2009, 02:48 PM
Hi,

I've implemented environment mapping to an object in my scene - this object reflects the environment. My problem is now that I want to mix the environment map with a normal texture so it doesnt look too metallic. For example a shiny stone (stone texture) that reflects just a little of its environment.

I hope you can help me ;) ...

Here's my current code for drawing such an object:

glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);

glEnable(GL_TEXTURE_CUBE_MAP);


glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);


glBindTexture(GL_TEXTURE_CUBE_MAP, m_envtex);

glPushMatrix();

GLfloat white[] = { 1.0, 1.0, 1.0, 1.0 };

glTranslatef(0,0,0);
glColor3f(1.0f, 1.0f, 1.0f);
gluSphere(sphere_quad,3, 10, 10);

glPopMatrix();

glDisable(GL_TEXTURE_CUBE_MAP);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);

scratt
06-15-2009, 05:48 PM
This should get you started..

http://jerome.jouvie.free.fr/OpenGl/Tutorials/Tutorial22.php

int0xicated
06-16-2009, 05:39 AM
ahh ok thank you alot - hmm but this looks like java, but I guess it's nearly the same with c++