Jump to content
  • Advertisement
Sign in to follow this  
Toolmaker

OpenGL Texture mapping discolorings

This topic is 3665 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 currently working on some OpenGL code for the application I professionally work on. I'm not well versed with OpenGL. What I did was update the way our application renders bitmaps. My predecessor never knew about textures on the videocard, so he figured it was a cool idea to just render all bitmap pixels as colored quads. I patched up his code by dumping the bitmap as a texture_2d on the GPU, and then rendering a textured quad with the texture bound to it. It all works great, with 1 exception. It somehow blends in additional color from the quad I draw. I turn off GL_BLEND with glDisable() before calling glBegin() and no errors occur. This is the output: And the original can be seen here: Any ideas? Toolmaker

Share this post


Link to post
Share on other sites
Advertisement
I think this should work:

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

I'm also not very familiar with OpenGL so I refer you here for more info.

Actually there should be a newer version of that particular chapter freely available somewhere, you might try looking for it.

Share this post


Link to post
Share on other sites
Same result... But I'm reading through some code and I ran into this:

GLfloat matdif[4] = { 1.0f, 1.0f, 1.0f, 1.0f}; // render color

glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, matdif);



Could that be related?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!