Before I start explaining my problem in detail, please bear in mind I’ve only started programming in OpenGL for a few months at my college, I’m using SOIL, GLEW and OpenGL 3.3 as my tools at the moment.
I’ve started making a 3D scene for a project at my college and everything is going well so far, except for one thing: My instructor and I can’t seem to be able to enable Anisotropic filtering?
We’ve spent a day or two searching about how we could get Anisotropic filtering to work, on all documentations I’ve found, this is quite the simple thing to enable!
I have this code that should enable anisotropic filtering:
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);
I also have mipmapping enabled in both OpenGL and SOIL, so anisotropy shouldn’t have any problem being enabled, right?
Not quite, for some reason this code does not do the trick, after spending hours on searching about this, there doesn’t seem to be any alternatives.
As a proof that anisotropy never gets set, I can force it to 16x in my video card control panel, compare for yourself:
[ATTACH=CONFIG]190[/ATTACH]
This picture is without forcing anisotropy to 16x, but yet still having the code that should enable it, clearly it’s not enabled when you compared it with the following image:
[ATTACH=CONFIG]191[/ATTACH]
(It’s hard to notice since the pictures are resized, but the first one has blue spots in the near distance while the other one with anisotropy forced, those blue spots disappears and the texture is much clearer)
I’ve tried adding a breakpoint just after the glGetFloatv, and largest_supported_anisotropy is equal to 16.f, which corresponds with what my video card can do.
This happens for both NVidia and ATI graphic cards, as I’ve had my friend try this with the same results.
I’m sorry if this question may seem stupid, but I can’t seem to find the answer anywhere to my problem. Any help is greatly appreciated!
If you need more information, I’ll be more than happy to provide!
Again, thanks in advance!