Jump to content
  • Advertisement

Archived

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

hello_there

texture problem

This topic is 5415 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 using tga files for my textures. When i map it to a triangle is repeats a bit of the top on the bottom and it looks real bad. Anyone know what might cause it to do this. I don''t think it''s the texture coordinates.

Share this post


Link to post
Share on other sites
Advertisement
I''m using format GL_RGBA and type GL_UNSIGNED_BYTE. I''m also using gluBuild2DMipmaps(). When i try to use glTexImage2D() now the texture just appears as white.

Share this post


Link to post
Share on other sites
If your texture coordinates are from 0 to 1 and you''re using bilinear filtering, the bottom pixels of the texture will be visible at the top and vice versa (blended halfway). This will be more visible if it''s using a smaller mipmap so adjusting the texture coordinates won''t always help. Have you tried using CLAMP_TO_EDGE?

Share this post


Link to post
Share on other sites
trilinear would be GL_LINEAR_MIPMAP_LINEAR .. But any filtering besides GL_NEAREST (which you don''t want) will have the same problem. It''s just how texture coordinates work.

Edge clamping requires OpenGL 1.2 or later and you use it by putting GL_CLAMP_TO_EDGE (0x812f) in the texture parameters instead of GL_REPEAT or GL_CLAMP.

Share this post


Link to post
Share on other sites
for stuff beyond 1.1 i recomend getting a hold of benjamin bunny''s GLee lib as it makes using ''em painless and fun :D

also, there is an artical on Gamedev about going beyond 1.1''s features, its probably a good idea for you to take a shifty at that as well

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!