Opengl Color And Lighting

Started by
2 comments, last by senem 16 years, 5 months ago
I use texture for some vertexes and colors for some vertexes at the same object. I use them partially at the same object. But, there are some problems texture mapping and colors when I use them together at the same object. Colors seems to be foggy and object seems to be transparent. Texture mapping side is mixed with colors. I want to make them clear (some parts in colors, some parts in texture mapping). How can I make the object clear(partially colored & partially textured ) ? What's wrong with it? Code is like following : .... glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glDepthMask(TRUE); .... glPushMatrix(); glPushMatrix(); glDisable(GL_TEXTURE_2D); glDisable(GL_LIGHTING); glBegin (GL_TRIANGLES); glColor3fv; glVertex3fv; glEnd (); glPopMatrix(); glPushMatrix(); glEnable(GL_TEXTURE_2D); glEnable(GL_LIGHTING); glBegin (GL_TRIANGLES); glTexCoord2f; glVertex3fv; glEnd (); glPopMatrix(); glPopMatrix;
Advertisement
Try glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)

The whole object needs texture coords but you use the texture's alpha channel to define the areas where the texture should be visible.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Texture coordinates and vertex coordinate are OK.
The problem is about colors and texture seems to be mixed.
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

This proc call solved the problem for texture image.
So texture image doesn't mix with color.

Some parts of object are covered with texture image(.tga). Some parts of object are red color, some parts of object are yellow.
The problem is solved on texture image.

But there is still same problem for color. Red color and yellow color are mixed in same object.

What can be solution for it ?

This topic is closed to new replies.

Advertisement