FYI, this is based on master and improves on this recent commit
https://github.com/FreeCAD/FreeCAD/comm ... 2c4e9f3ed5. Best noticeable in the text on the cube's faces when rotating.
Now I've seen that the
generateMipMaps() call is not necessary, it seems mipmaps are generated automatically by default. So it is only 2 lines changed:
Code: Select all
--- "a/I:\\src\\_Ext\\FreeCAD\\src\\Gui\\NaviCube.cpp"
+++ "b/I:\\src\\_Ext\\FreeCAD\\src\\Gui\\NaviCube-orig.cpp"
@@ -422,7 +422,7 @@ GLuint NaviCubeImplementation::createCubeFaceTex(QtGLWidget* gl, float gap, cons
Q_UNUSED(gl);
QOpenGLTexture* texture = new QOpenGLTexture(image.mirrored());
m_glTextures.push_back(texture);
- texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
+ texture->setMinificationFilter(QOpenGLTexture::Linear);
texture->setMagnificationFilter(QOpenGLTexture::Linear);
return texture->textureId();
}
@@ -527,7 +527,7 @@ GLuint NaviCubeImplementation::createButtonTex(QtGLWidget* gl, int button) {
Q_UNUSED(gl);
QOpenGLTexture* texture = new QOpenGLTexture(image.mirrored());
m_glTextures.push_back(texture);
- texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
+ texture->setMinificationFilter(QOpenGLTexture::Linear);
texture->setMagnificationFilter(QOpenGLTexture::Linear);
return texture->textureId();
}
In short, when rendering textures at a smaller resolution (minification), best result is with LinearMipmapLinear minification filtering.