activating anisotropic filtering

hello, i am trying to active anisotropic filtering using;


		if (gl.glGetString(GL.GL_EXTENSIONS).contains("GL_EXT_texture_filter_anisotropic")) {
			FloatBuffer maxAnisotropy = FloatBuffer.allocate(1);
			gl.glGetFloatv(GL.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy);
			gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy.get(0));
		
		}

but it does not seem to work.
any ideas what the problem could be?
thanks!

have you bound a texture?

DP

if you mean, if my objects are textured, then yes, all of them are.

if i turn on anisotropic filtering in the drivers settings it works and looks beautiful, but when i have it set to “application controlled” the distant textures look very unsharp.

What darkprophet meant was that you need to bind a texture object to GL_TEXTURE_2D before calling glTexParameterf. In other words the maximum anisotropy of a texture has to be set on a texture by texture basis; not as a single one off initialisation bit of code. Are you’re doing this correctly?

ah ok, i understand.
yes i missed that.
is there an option to turn this on as a default for all textures?

thanks!

No, as far as I know you cannot change the default values.