7
\$\begingroup\$

I am loading a texture and using glGenerateMipmap() on it to achieve some level of mipmaping.

I get different result on nVidia gt 555m, and on Intel HD 3000.

The texture rendered by nVidia is not with Anisotropic filtering, and that rendered by intel HD 3k is. How to manually adjust this feature for different GPU?

Also the tiling of the texture is much more apparent on nVidia!! enter image description here

enter image description here In the description of glGenerateMipmap() it is specified that the way glGenerateMipmap works is different for different implementations of OpenGL.

Is this something to do with glHint() GL_FASTEST , GL_NICEST , and GL_DONT_CARE? Or am I better of mipmaping the texture myself?

\$\endgroup\$
5
  • \$\begingroup\$ It seems it is something to do with the Anisotropic filtering. \$\endgroup\$
    – 2am
    Commented Jan 26, 2014 at 19:21
  • \$\begingroup\$ The scale of the texture looks different between the two pictures. With nVidia the texture is repeating faster than on Intel. Maybe there is something else wrong than the mipmap generation. \$\endgroup\$
    – msell
    Commented Jan 26, 2014 at 19:23
  • \$\begingroup\$ the screenshot I added just now backs up what you said. What could be wrong? I am using glTexImage2D instead of glTexStorage2D. Followed this tutorial OpenGL Automatic mipmap generation \$\endgroup\$
    – 2am
    Commented Jan 26, 2014 at 19:33
  • 1
    \$\begingroup\$ Sometimes in the driver options a 'fast' or 'quality' preset has been turned on. This may override what the application requests. That does not explain the diffirence in tiling though. \$\endgroup\$
    – Lasse
    Commented Jan 27, 2014 at 5:39
  • \$\begingroup\$ @Lasse, after changing the setting the texture in my code was rendered with full 16x anisotropic filtering. \$\endgroup\$
    – 2am
    Commented Jan 28, 2014 at 13:46

1 Answer 1

9
\$\begingroup\$

If you have the EXT_texture_filter_anisotropic extension, you can set the maximum texture anisotropy parameter using glTexParameterf to allow the driver to take more samples during texture filtering.

A code snippet:

float aniso = 0.0f;
glBindTexture(GL_TEXTURE_2D, texName);
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &aniso);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso); 
\$\endgroup\$
2
  • 7
    \$\begingroup\$ It is also worth mentioning that this is a sampler state. Even though this extension is still not core in OpenGL, if you have an implementation that supports sampler objects, then you can set this per-sampler instead of per-texture. The GL specification does not list it as a per-sampler state (since it is an extension), but it is. \$\endgroup\$ Commented Jan 27, 2014 at 21:57
  • 1
    \$\begingroup\$ Is that likely to be available in every implementation supporting sampler objects? \$\endgroup\$ Commented Oct 25, 2015 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .