Sign in to follow this  
RedDragon0509

prevent blending with BMP tile

Recommended Posts

RedDragon0509    134
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
RedDragon0509    134
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this