Jump to content
  • Advertisement

Archived

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

canuckle

OpenGL OpenGL texture filtering problem

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

Hello, I''ve been trying to do OpenGL filtering with GL_LINEAR for MIN and GL_NEAREST for MAG: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); But it shows both as GL_NEAREST. On the other hand, if I use GL_NEAREST for MIN and GL_LINEAR for MAG, or GL_LINEAR for both, they work as expected. Is this a hardware issue? Does anyone have an idea of what''s wrong? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
i don''t know if there''s hardware which supports GL_LINEAR for MIN; the common way is to use mipmaps. then you can use GL_NEAREST_MIPMAP_NEAREST (no interpolation), GL_NEAREST_MIPMAP_LINEAR (interpolation only between 2 mipmaps), GL_LINEAR_MIPMAP_NEAREST (interpolation only within a mipmap) or GL_LINEAR_MIPMAP_LINEAR (interpolation within 2 mipmaps and between the 2 mipmaps; this is sometimes called trilinear filtering).

Share this post


Link to post
Share on other sites
If I do GL_LINEAR for both MIN and MAG, it works, so I know that it''s possible to do GL_LINEAR for MIN.

I''m trying to avoid mipmaps because I might have many of these textures (where some might not be even drawn) and want to economize texture space. I''ll try to use mip maping for MIN and see what happens, though.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you don''t want mip maps then use GL_LINEAR for both, minification and magnification. Otherwise use GL_LINEAR_MIPMAP_NEAREST (bilinear) or GL_LINEAR_MIPMAP_LINEAR (trilinear) as minifiaction filter.

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!