Sign in to follow this  
dpadam450

anisotropic filtering

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this