Jump to content
  • Advertisement
Sign in to follow this  
Prune

glTexParameterf of glTexParameteri for GL_TEXTURE_MAX_ANISOTROPY_EXT

This topic is 4139 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've seen both. Which one should I use? glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, ...) vs glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, ...)

Share this post


Link to post
Share on other sites
Advertisement
glTexParameteri is the int version of the function

and

glTexParameterf is the float version

so you should use it like so

Glfloat largest_supported_anisotropy;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);

HTH

Share this post


Link to post
Share on other sites
Thanks. I knew one is float and one integer, but I didn't find a solid reference saying which one this parameter should be.

Share this post


Link to post
Share on other sites
Quote:
Original post by Prune
Thanks. I knew one is float and one integer, but I didn't find a solid reference saying which one this parameter should be.
If you're just setting the anisotropy to a whole number, either function will be fine. As for the parameter itself...
Quote:
From the GL_EXT_texture_filter_anisotropic spec
Additions to Chapter 3 of the 1.2 Specification (Rasterization)

-- Sections 3.8.3 "Texture Parameters"

Add the following entry to the end of Table 3.17:

Name Type Legal Values
-------------------------- ------ --------------------------
TEXTURE_MAX_ANISOTROPY_EXT float greater or equal to 1.0

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.

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!