• Advertisement
Sign in to follow this  

anisotropic filtering

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

Here are my current texture parameters. What exactly do I need to keep or take out because none of the results are changing and look bad still. glGenTextures(1, &(this->GL_Texture_Index)); glBindTexture(GL_TEXTURE_2D, (this->GL_Texture_Index)); glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); float largest_supported_anisotropy; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy); glTexParameteri(GL_TEXTURE_2D, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy);

Share this post


Link to post
Share on other sites
Advertisement
I forced it to 16x in the NVIDIA control panel, but when I do application controlled it doesn't work. Not sure what else other than setting the texture parameter there is to do.

Share this post


Link to post
Share on other sites
Read the specs: http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);

this should be:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

and

glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP,GL_LINEAR);

should be:

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

Share this post


Link to post
Share on other sites
That didnt work either, the GL_TRUE ended up not mattering because GL_LINEAR is a non-zero # and is converted to true.

The GL_LINEAR simply made it GL_LINEAR default (no mip-mapping, no anisotropic)

Share this post


Link to post
Share on other sites
I recommend glGetError. It helps to locate problems.
Here is the corrected code

glGenTextures(1, &(this->GL_Texture_Index));
glBindTexture(GL_TEXTURE_2D, (this->GL_Texture_Index));

glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP,GL_TRUE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

float largest_supported_anisotropy;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_ANISOTROPY_EXT, largest_supported_anisotropy);



which is from the Wiki
http://www.opengl.org/wiki/Texture_Mapping

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement