Anti-Aliasing

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
jmaustpc
Posts: 9639
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Fri May 09, 2014 10:17 am

wmayer wrote:But I have no idea if disabling glDepthRange causes a regression somewhere and thus I think we should do the change after 0.14 is out so that we have more time for testing.
But then 0.14 will be left with a pretty ugly bug, wouldn't it be better to include this, test for week or two, if it does show up any regressions then remove the patch if you want to before releasing 0.14?
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Anti-Aliasing

Postby quick61 » Fri May 09, 2014 4:05 pm

ickby, your anti-aliasing patch works a treat. I hardly notice any performance hit on my system until I hit MASS 8X. Between None and MSAA 4X, there is very little difference in my FPS. With 8X, there is about a 50% drop. With little visual difference between 4X and 8X, for me, 4X seems to be a good setting with no noticeable reduction in performance "feel". Thanks for this.

I have noticed that this improved visual quality does not seem to translate to the Tools > Save picture... function. Is this because of the compression level of the saved image, or is the image being taken from a process before the anti-aliasing? Any fix for this part (Save picture... tool)

Both the pics below were taken with MSAA set at 8X one with FreeCAD's tool, the other with KSnapshot
X8_FreeCAD_Save_picture.png
Screenshot taken with FreeCAD > Tools > Save picture...
X8_FreeCAD_Save_picture.png (13.37 KiB) Viewed 2427 times
X8_KSnapshot.png
Screenshot taken with KSnapshot
X8_KSnapshot.png (27.97 KiB) Viewed 2427 times
Mark

Nvidia GForce 9500 GT (G96)
1 GB RAM
Nvidia 331.67 driver
1.375 Ghz GPU

OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3562 (Git)
Branch: master
Hash: 320fabfc987d750303f3fe777238c67ae980acd9
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.7.0
This post made with 0.0% Micro$oft products - GOT LINUX?
wmayer
Site Admin
Posts: 15756
Joined: Thu Feb 19, 2009 10:32 am

Re: Anti-Aliasing

Postby wmayer » Fri May 09, 2014 5:26 pm

jmaustpc wrote:But then 0.14 will be left with a pretty ugly bug, wouldn't it be better to include this, test for week or two, if it does show up any regressions then remove the patch if you want to before releasing 0.14?
OK, I have tested many things and didn't find a regression. So, the fix is now active.

However, I found a regression when anti-aliasing is on. Whenever you draw into the front buffer (happens with the mesh cutting/trimming or the rubberband selection in the sketcher) the repainting doesn't work properly any more. So, when doing so I temporarily deactivate the anti-aliasing.
jmaustpc
Posts: 9639
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Fri May 09, 2014 7:13 pm

wmayer wrote:
jmaustpc wrote:But then 0.14 will be left with a pretty ugly bug, wouldn't it be better to include this, test for week or two, if it does show up any regressions then remove the patch if you want to before releasing 0.14?
OK, I have tested many things and didn't find a regression. So, the fix is now active.

However, I found a regression when anti-aliasing is on. Whenever you draw into the front buffer (happens with the mesh cutting/trimming or the rubberband selection in the sketcher) the repainting doesn't work properly any more. So, when doing so I temporarily deactivate the anti-aliasing.
Thanks, it looks great with this simple test. :-)
transparencytest.jpg
transparencytest.jpg (20.18 KiB) Viewed 2392 times
Although the tools, save a picture, above does not look as good as the real thing in my display as shown with a screen capture. Look at the cylinder in side the transparent cube. The above is from the Tools menu, save picture.....and the below is from a KDE screen capture application.
transparencytestscreenshot.png
transparencytestscreenshot.png (21.94 KiB) Viewed 2392 times
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Re: Anti-Aliasing

Postby detlet » Sat May 10, 2014 6:22 am

The anti aliasing is great! But I stumbled over two problems. First: If you have a image plan and anti aliasing is not activated, the image is shown as a grey rectangle. This may be confusing. Second: In a project, where I use an image plane (PNG 1412x1242) I got this error on the console:

Code: Select all

Coin error in SoNode::GLRenderS(): GL error: 'GL_OUT_OF_MEMORY', nodetype: Separator (set envvar COIN_GLERROR_DEBUGGING=1 and re-run to get more information)
. It was at a point, where the Sketcher had a problem to solve the sketch. I couldn't reproduce it till now, with the environment variable set. From the error message I think, that graphics card was gone out of RAM.

AMD Radon HD 5450
512 MB

OS: Debian GNU/Linux testing (jessie)
Platform: 64-bit
Version: 0.14.3563 (Git)
Branch: master
Hash: a5efc53bfcbdaeeec09bef30dd3203c6b4cfdb6f
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
jmaustpc
Posts: 9639
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Sat May 10, 2014 10:43 am

detlet wrote:The anti aliasing is great! But I stumbled over two problems. First: If you have a image plan and anti aliasing is not activated, the image is shown as a grey rectangle. This may be confusing. Second: In a project, where I use an image plane (PNG 1412x1242) I got this error on the console:

Code: Select all

Coin error in SoNode::GLRenderS(): GL error: 'GL_OUT_OF_MEMORY', nodetype: Separator (set envvar COIN_GLERROR_DEBUGGING=1 and re-run to get more information)
. It was at a point, where the Sketcher had a problem to solve the sketch. I couldn't reproduce it till now, with the environment variable set. From the error message I think, that graphics card was gone out of RAM.

AMD Radon HD 5450
512 MB

OS: Debian GNU/Linux testing (jessie)
Platform: 64-bit
Version: 0.14.3563 (Git)
Branch: master
Hash: a5efc53bfcbdaeeec09bef30dd3203c6b4cfdb6f
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Can you post a file that demonstrates these issues?
kwahoo
Posts: 275
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

Postby kwahoo » Sat May 10, 2014 10:57 am

detlet wrote: From the error message I think, that graphics card was gone out of RAM.
FYI: If you are using open source drivers, you can draw some graphs (to monitor VRAM usage) inside the FreeCAD GL viewport:

Code: Select all

GALLIUM_HUD=VRAM-usage,requested-VRAM freecad
MSAAx8, 300MiB memory usage:
Image

And 1412x1242 PNG image MSAAx8, 436MiB:
Image

OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3559 (Git)
Branch: master
Hash: 1fffc978b4c2873da5826c1de12207f3b292c4cf
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: Anti-Aliasing

Postby cblt2l » Sat May 10, 2014 3:45 pm

Maybe someone else can confirm this but none of the MSAA types seem to work on my Ivy Bridge HD4000 chipset. The console gives this warning when I switch between them:

Code: Select all

Coin warning in SoQtGLWidgetP::buildGLWidget(): wanted sample buffers, but that is not supported by the OpenGL driver
OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 64-bit
Version: 0.14.3606 (Git)
Branch: master
Hash: 1816c22f8d1fe4f348c40ae9976845d69fc5fc53
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
kwahoo
Posts: 275
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

Postby kwahoo » Sat May 10, 2014 4:26 pm

cblt2l wrote:Maybe someone else can confirm this but none of the MSAA types seem to work on my Ivy Bridge HD4000 chipset.
Works fine for me.

Code: Select all

glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile x86/MMX/SSE2
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel
OpenGL core profile shading language version string: 3.30
OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3559 (Git)
Branch: master
Hash: 1fffc978b4c2873da5826c1de12207f3b292c4cf
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
ulrich1a
Posts: 1922
Joined: Sun Jul 07, 2013 12:08 pm

Re: Anti-Aliasing

Postby ulrich1a » Sat May 10, 2014 4:31 pm

cblt2l wrote:Code: Select all
Coin warning in SoQtGLWidgetP::buildGLWidget(): wanted sample buffers, but that is not supported by the OpenGL driver



OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 64-bit
Version: 0.14.3606 (Git)
It may be a Debian wheezy issue. I got the same message with a Radeon HD4670.

Code: Select all

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD RV730
OpenGL version string: 2.1 Mesa 8.0.5
OpenGL shading language version string: 1.20
OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 32-bit
Version: 0.14.3564 (Git)
Branch: master
Hash: 3f4cbc421766b841cebcdf57a3de9a2c8211070c
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0

Ulrich