Skip to main content
GameDev.net gamedev.net
🔒 Locked

anisotropic filtering

Started by dpadam450 May 29, 2009 at 2:09 AM 3 replies 2.4k views
Original Post
dpadam450
dpadam450
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);
NBA2K, Madden, Maneater, Killing Floor, Sims 
dpadam450
dpadam450
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.
NBA2K, Madden, Maneater, Killing Floor, Sims 
i_luv_cplusplus
i_luv_cplusplus
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);
OpenGL fanboy.
dpadam450
dpadam450
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)
NBA2K, Madden, Maneater, Killing Floor, Sims 
V-man
V-man
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.