Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6060 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using light map. When light texture id is active (!=0) for a set of polygons I''m selecting multitextures, if not I''m using one texture. In my scene I have lighted walls and unlightted wals. In some circumstances the texture are get messed up on the walls that are using one texture (texture is beeinbg replaced with other textures from around while I''m moving in 3d space). Here is my code that does the preparation. What''s wrong !!! glColor3fv(polygon.color); if(textureID > 0) { glEnable(GL_TEXTURE_2D); if(polygon.textureID > 0 && polygon.ilumtextureID > 0) { glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D, polygon.textureID); glActiveTextureARB(GL_TEXTURE1_ARB); glBindTexture(GL_TEXTURE_2D, polygon.ilumtextureID); } else { glBindTexture(GL_TEXTURE_2D, polygon.textureID); } } glBegin(GL_TRIANGLE_STRIP); { PVtciItm it = polygon.v_pvtci.begin(); for(; it != polygon.v_pvtci.end();it++) { if((bool)it->clr) // vertex has it''s own color glColor4fv((float*)it->clr); if(polygon.ilumtextureID) { glMultiTexCoord2fARB(GL_TEXTURE0_ARB,it->tex.u, it->tex.v); glMultiTexCoord2fARB(GL_TEXTURE1_ARB,it->lm.u, it->lm.v); } else if(polygon.textureID) { glTexCoord2f(it->tex.u,it->tex.v); } glVertex3f(it->pt->x,it->pt->y,it->pt->z); } } glEnd(); glDisable(GL_TEXTURE_2D); buflea

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!