Jump to content
  • Advertisement

Archived

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

Marius

multitextures

This topic is 6181 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

OS: OpenGL/Nvidia Geforce, Win2K I do have a small scene of 3d graphics (blocks cylinders, etc). Some of them are just colored, other have 2D-textures. I have been using open gl lights to emphasize the scene. Now the scene get''s more complex I get rid of pohong and I use map lighting. My code looks (pseudo for easy read) ::Render(SOmeObj& object) { if(object.Texture0) // paint multitextures faces { glColor4fv((float*)object.Color); glEnable(GL_TEXTURE_2D); if(object.Texture1) { glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D,object.Texture0); glActiveTextureARB(GL_TEXTURE1_ARB); glBindTexture(GL_TEXTURE_2D,pface.Texture1); glBegin(...) while(object.NextVertex()) { glMultiTexCoord2fvARB(GL_TEXTURE0_ARB,(float*)object.Texture0Coord); glMultiTexCoord2fvARB(GL_TEXTURE0_ARB,(float*)object.Texture1Coord); glVertex3fv((float*) object.Vertex); } glEnd(); } else // paint one texture faces { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,pface.Texture0); glBegin() while(object.NextVertex()) { glTexCoord2f((float*)object.Texture0Coord); glVertex3fv((float*) object.Vertex); } glEnd(); } glDisable(GL_TEXTURE_2D); } else // paint colored ones, glDisable(GL_TEXTURE_2D); is default { glBegin(...); while(object.NextVertex()) { glColor4fv((float*)object.Vertex.Color); glVertex3fv((float*) object.Vertex); } glEnd(); } } The results are messy. My hitmark get''s screwed, gets different colors while I''m walking in the scene, colorred faces get darger or lighter, (I have opengl light disabled), one thexture faces are changing the texture between them and multitexture faces as well. If I''m disabling the 2''th light map texture everything is fine. If I let it in geee. I tried this on NVidia, maxtor and ATI and I get the same results. Anyone can help me. sorry for spelling Thanks.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!