Archived

This topic is now archived and is closed to further replies.

Perost

Black lines in textures

Recommended Posts

Hi! I''m working on a 2D rpg game in opengl, and I''ve got a small problem. Sometimes small black lines show up around the textures, and as you move around the map they flicker. Sometimes they''re there, sometimes not. Here''s a screenshot: http://hem.passagen.se/perost/screen1.jpg Notice the black lines above the trees? Do anyone know what''s the cause of this. I''ve searched the internet, but couldn''t find anything. I''d really appreciate some help.

Share this post


Link to post
Share on other sites
Those lines are the bottom of the trees wrapping around to the top. Either clamp the textures in openGL (search for clamp), or edit the texture file so that the tree trunk doens''t go all the way to the bottom of the image. (Delete the last couple of rows at the bottom of your image. Replace with transparency.)

-Madgap

Share this post


Link to post
Share on other sites
GL_CLAMP clamps to the border colour, which is probably not what you want. Use GL_CLAMP_TO_EDGE instead. It''s not defined in the standard headers. Look in glext.h (see the Forum FAQ), or use GLee (see sig).

____________________________________________________________
www.elf-stone.com | Automated GL Extension Loading: GLee 3.04 for Win32 and Linux

Share this post


Link to post
Share on other sites
I got it to work, and I think I used GL_CLAMP_TO_EDGE (I''m using another computer, so I can''t see right now). I didn''t need any extra header-files, only gl.h. I think that''s because I use linux, I don''t think you need glext.h in linux. Or am I wrong?

Share this post


Link to post
Share on other sites
quote:
Original post by Perost
I didn''t need any extra header-files, only gl.h. I think that''s because I use linux, I don''t think you need glext.h in linux. Or am I wrong?


That''s correct, most of the time (although the it''s dependent on which headers you''re using). If you intend to make it cross-platform it at some point, you''ll need a cross-platform solution though.

Share this post


Link to post
Share on other sites