Jump to content
  • Advertisement
Sign in to follow this  
Tokage

Silly Bothersome Texture Problem

This topic is 5050 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 feel dumb asking this, but I will anyway. I'm loading an image from a bitmap file that I want to display on the screen. In order to make it display more quickly, I'm drawing it as a texture-mapped rectangle rather than drawing the pixels directly. When I do this, though, the texture is kind of fuzzy. Does that have something to do with the mipmaps? If so, what do I do to make the texture display on the screen exactly as it is defined in the file?

Share this post


Link to post
Share on other sites
Advertisement
You need to create the texture so that it doesn't have any filtering.

From NeHe's site:


glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // ( NEW )
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); // ( NEW )
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);





This will create a texture with the "nearest" filtering type. This will not attempt to smooth the image over in any way. Basically, the "GL_NEAREST" tells OGL to not average pixels around it when enlarging or shrinking the texture.

Share this post


Link to post
Share on other sites
Quote:
Original post by Tokage
That doesn't seem to be helping. Maybe I should post a screenshot of what I mean?


Couldn't hurt [smile]. Also, if you have aim, it would be much easier to sort this out through it. PM me your sn if you so please (since I am on now anyway).

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.

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!