texture mapping
howcome my texture mapping code doesn''t work if I dont put color.. (im using multiple viewports)
glLoadIdentity();
glBindTexture(GL_TEXTURE_2D, texture[0]);
glColor3f(0.0f,1.0f,1.0f);<-----if I remove this I can''t see anything
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex2i(0,200);
glTexCoord2f(1.0f, 0.0f);
glVertex2i(200,200);
glTexCoord2f(1.0f, 1.0f);
glVertex2i(200,0);
glTexCoord2f(0.0f, 1.0f);
glVertex2i(0,0);
glEnd();
depends on the texture mode.
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, _____);
if it is GL_MODULATE then the texture color is multiplied by the color (so 0,0,0 would never produce any output).
if it is GL_DECAL, then OGL should just paste the texture on without consulting the normal color.
lonesock
Piranha are people too.
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, _____);
if it is GL_MODULATE then the texture color is multiplied by the color (so 0,0,0 would never produce any output).
if it is GL_DECAL, then OGL should just paste the texture on without consulting the normal color.
lonesock
Piranha are people too.
lonesockPiranha are people too.www.lonesock.netSOIL: Simple OpenGL Image LibraryMovies I've mocked: "The Core", "The Mummy", "Tale of Despereaux"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement