tile texture problems

Started by
5 comments, last by EvDaedalus 18 years, 4 months ago
I am working on a 2D side scrolling tile based game using OpenGL. I am trying to contain more than one world texture in one big bitmap file and when I render the tiles I just use the correct TexCoord's. But when I am rendering I get funny edges because the textures loop around a tiny bit. If I have a tile with a light bottom and a dark top, or a solid bottom and transparent top I get a light line drawn at the top of the tile. Is there any way to specify more exact tex coordinates rather than those floating points, or stop it from doing that loop around? example pic: http://members.gamedev.net/daedalus_/pic1.JPG
Advertisement
Goto nvidia and grab their texture atlas tool. I am not sure how you are making your textures or combining them into one but this tool should help you out... Also are you repeating the textures or clamping them to 0-1
I set it to GL_CLAMP, but I still get that stupid loop around. I thought it was just with the textures I had put together in one big file, but even with any texture that is transparent at the top and not at the bottom, it makes a line at the top of the tile!
And I forgot to add, whats strange is that the lines are not always present, but only when the camera is at certain Y positions. As you move up and down they appear and dissapear.. its very frustrating!
use filter nearest or texture borders.
[size="2"]I like the Walrus best.
You say you are packing your textures into one supertexture. In that case, GL_CAMP will do you no good for any textures not at the edge of that texture.
Like Owl said, use nearest filter or borders around your individual textures. Actually, use both. Also, make sure you are not using mipmapping.
Oh wow.. thank you guys so much! I didn't even realize that the LoadTGA function I was using assigned linear filtering! I have tried sooooo long to make those stupid lines go away and now poof! They are gone!

Problem solved! :)

This topic is closed to new replies.

Advertisement