NaviCube Anti-Aliasing (lack therof)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
NaviCube Anti-Aliasing (lack therof)
Current AA settings preferences don't apply to the NaviCube, most likely due to the way it is drawn into the viewport. As a comparison, LinkStage/LinkDaily builds do not seem to display the same pixelation to edges/fonts.
Using Manjaro Linux and latest development appimages.
Re: NaviCube Anti-Aliasing (lack therof)
"Latest" can be already outdated one day later. Please always add your FreeCAD infos to such posts.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: NaviCube Anti-Aliasing (lack therof)
FreeCAD_weekly-builds-28193-Linux-Conda_glibc2.12-x86_64.AppImage
Manjaro 64 Bit
I'm unable to paste the info directly from clipboard because I am only able to access the internet from a government computer and cannot install 3rd party software onto it. I run FreeCAD on a non-networked machine right now, as I am on a Navy ship out to sea.
Also, I believe this to still be the case as I have reviewed the git history here, and while I'm not able to fully understand all of the code, the comments do not imply that this has been addressed: https://github.com/FreeCAD/FreeCAD/comm ... viCube.cpp
This has been noted in the past by chennes and donovally (uwestoehr on the forum I think?) since this PR reworking the NaviCube:
https://github.com/FreeCAD/FreeCAD/pull ... -786992101
Re: NaviCube Anti-Aliasing (lack therof)
I think you need to be looking at the code in View3DInventorViewer.cpp -- my read is that the MSAA is being applied to the framebuffer before the navicube is being drawn.
Re: NaviCube Anti-Aliasing (lack therof)
When speaking about Qt and interfaces there are many "layers" of complexity between the graphics hardware and the "toolkit".
Sadly without seeing what is used and what is implemented, maybe even in some obscure Qt setting around it is difficult to pinpoint the problem.
I have had recently many artifacts in FC and they were triggered to a chaneg in "mesa" library that I have to downgrade in my Arch Linux distribution as 22.0.0 was creating strange results.
Take in account that antialising could be even set in the WM or the DE or by Compositor if you use one, or maybe even by some settings in the Qt part, as some recent findings about "Disappearing Start page" has revealed.
This complexity sadly is not very easy to manage without knowing what "visualization chain" you are using.
Graphics hardware > OpenGl implementation > .... > .... > Qt.
It is not even to easy to pinpoint all the exact steps, I was directed to issue these commands when I have had problems:
and:
Probably these could be a decent starting point in trying to see what graphics chain is use, and maybe solve things, if related.
Anyone know other commands, or ways to inspect what is used maybe at Qt level with "environment variables"
in Python console this could gave some ideas:
Hope it helps
Carlo D.
Sadly without seeing what is used and what is implemented, maybe even in some obscure Qt setting around it is difficult to pinpoint the problem.
I have had recently many artifacts in FC and they were triggered to a chaneg in "mesa" library that I have to downgrade in my Arch Linux distribution as 22.0.0 was creating strange results.
Take in account that antialising could be even set in the WM or the DE or by Compositor if you use one, or maybe even by some settings in the Qt part, as some recent findings about "Disappearing Start page" has revealed.
This complexity sadly is not very easy to manage without knowing what "visualization chain" you are using.
Graphics hardware > OpenGl implementation > .... > .... > Qt.
It is not even to easy to pinpoint all the exact steps, I was directed to issue these commands when I have had problems:
Code: Select all
glxinfo -B
Code: Select all
lspci -knn | grep -iA4 vga
Anyone know other commands, or ways to inspect what is used maybe at Qt level with "environment variables"
in Python console this could gave some ideas:
Code: Select all
print(os.environ)
Hope it helps
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: NaviCube Anti-Aliasing (lack therof)
even in /src/Gui/NaviCube.cpp there are code comments mentioning that anti-aliasing needs to be added.
The NaviCube is drawn using QPainter. Now, according to the API you should be able to use something along the lines of the the following in the createCubeFaceTex() method right after paint.begin(&image);
"paint.setRenderHints(QPainter::Antialiasing);"
I've also tried using the following in that method:
beginNativePainting();
*paint the face here codeblock*
endNativePainting();
However when doing this, it has no affect on the drawn cube. Chennes may be correct in his assumption that the issue lies in how the NaviCube is applied to the framebuffer in View3dInventorViewer.cpp
Sadly it's a fair bit above my current level of programming knowledge to understand fully whats going on with how the cube is rendered. I even tried easter-egging things to try and get an improved result with no luck.
The NaviCube is drawn using QPainter. Now, according to the API you should be able to use something along the lines of the the following in the createCubeFaceTex() method right after paint.begin(&image);
"paint.setRenderHints(QPainter::Antialiasing);"
I've also tried using the following in that method:
beginNativePainting();
*paint the face here codeblock*
endNativePainting();
However when doing this, it has no affect on the drawn cube. Chennes may be correct in his assumption that the issue lies in how the NaviCube is applied to the framebuffer in View3dInventorViewer.cpp
Sadly it's a fair bit above my current level of programming knowledge to understand fully whats going on with how the cube is rendered. I even tried easter-egging things to try and get an improved result with no luck.
Re: NaviCube Anti-Aliasing (lack therof)
Yes but the problem with most of the Gui things are that some "functions" are passed to the graphics chain, so if my "graphics drivers" has "no antialiasing" capabilities it is simply ignored.
Same as for advanced things like subpixel hints and so on.
For some graphics cards, at least on Linux there are different flavours, some uses a "framebuffer" some use "native rendering" some other use "proprietary dirvers" so having only informations about graphics card type is not enough.
For which I have asked if there is some way to have more information about the "graphics chain", see maybe:
https://wiki.archlinux.org/title/Intel_graphics
Only to see the complexity of the matter.
(usually on ArchLinux and Gentoo wiki you will find decent explanations on many things, sadly they are a wiki for a distribution, but "better than nothing")
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: NaviCube Anti-Aliasing (lack therof)
what kind of graphics driver doesn't have anti alias?? I would think that would be a very basic feature
Re: NaviCube Anti-Aliasing (lack therof)
Carlo,
The anti-aliasing for the NaviCube has nothing to do with the graphics stack. MSAA works in the viewport, but due to how it is drawn it doesn't apply to the NaviCube, this was tested on both Windows and Manjaro Linux using a NVIDIA RTX2060 GPU with robust proprietary drivers that are OpenGL API compliant. Additionally the same on an older laptop with NVIGIA 640LM mobile graphics and also while it runs off the intel iGPU. FreeCAD does not really take advantage of shaders and renders OpenGL to a framebuffer. Additionally, FreeCAD renders with MSAA even on something as minor as a Raspberry Pi, so while I understand your points I find them more distracting than enlightening.
Regards,
Obelisk
The anti-aliasing for the NaviCube has nothing to do with the graphics stack. MSAA works in the viewport, but due to how it is drawn it doesn't apply to the NaviCube, this was tested on both Windows and Manjaro Linux using a NVIDIA RTX2060 GPU with robust proprietary drivers that are OpenGL API compliant. Additionally the same on an older laptop with NVIGIA 640LM mobile graphics and also while it runs off the intel iGPU. FreeCAD does not really take advantage of shaders and renders OpenGL to a framebuffer. Additionally, FreeCAD renders with MSAA even on something as minor as a Raspberry Pi, so while I understand your points I find them more distracting than enlightening.
Regards,
Obelisk
Re: NaviCube Anti-Aliasing (lack therof)
Hi,
I just tried a little change in NaviCube.cpp and I think a got an improvement here. Look at the "RIGHT" text. and the outer borders (not the arrows though)
I only changed one of the texture creation blocks and set the minification filter to LinearMipMapLinear:
I just tried a little change in NaviCube.cpp and I think a got an improvement here. Look at the "RIGHT" text. and the outer borders (not the arrows though)
I only changed one of the texture creation blocks and set the minification filter to LinearMipMapLinear:
Code: Select all
texture->generateMipMaps(); // <-- also this, need to create mipmaps
texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear); // <--
texture->setMagnificationFilter(QOpenGLTexture::Linear);