• Advertisement
Sign in to follow this  

prevent blending with BMP tile

This topic is 4639 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 writing a 2D plateform game and im trying to draw an individual tile from a larger bmp, but a strip on the sides always blends with the tile next to it when the bmp is loaded (using nehe BMP to texture loader), I have turned blending off but it still happens. Is there any way around this? load the BMP: AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); glGenTextures(1, &textureArray[ID]); glBindTexture(GL_TEXTURE_2D, textureArray[ID]); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pBitMap->sizeX, pBitMap->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); ----------------------------------------------- original BMP: Image Hosted by ImageShack.us Loaded BMP: Image Hosted by ImageShack.us This isn't bad except when the blue (sky) tiles are next to eachother: Image Hosted by ImageShack.us [Edited by - RedDragon0509 on June 6, 2005 8:50:33 AM]

Share this post


Link to post
Share on other sites
Advertisement
perhaps a screenie of whats going wrong would help us see the problem.

Share this post


Link to post
Share on other sites
Try setting texture filtering to GL_NEAREST and warping to GL_CLAMP or GL_CLAMP_TO_EDGE.

Share this post


Link to post
Share on other sites
well i tried changing the texture filtering to GL_NEAREST and warping to GL_CLAMP or GL_CLAMP_TO_EDGE but when i did this i still got:
Image Hosted by ImageShack.us

so i just moved the blue tile to the beginning of the image... so now i have a clear blue sky:
Image Hosted by ImageShack.us


though i should figure out how to code it right so i dont have to re-arrange my tilesets

Share this post


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

  • Advertisement