Jump to content
  • Advertisement
Sign in to follow this  
EvDaedalus

OpenGL tile texture problems

This topic is 4860 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 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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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! :)

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!