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);