Anti-Aliasing

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: Anti-Aliasing

Postby cblt2l » Sat May 10, 2014 4:40 pm

kwahoo wrote:Works fine for me.
ulrich1a wrote:It may be a Debian wheezy issue. I got the same message with a Radeon HD4670.
Since kwahoo has no problems running a much more recent version of mesa I'm guessing that is the problem.
kwahoo
Posts: 363
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Anti-Aliasing

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

ulrich1a wrote: 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
IIRC MSAA for R600g (Radeon HD2000-6000) driver was introduced somewhere around Mesa 10.1...
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Re: Anti-Aliasing

Postby detlet » Sun May 11, 2014 6:12 am

jmaustpc wrote:Can you post a file that demonstrates these issues?
For the disappearing images it doesn't depend on a special file. So here is, how I can reproduce it with any image:
set anti-aliasing to none in the configuration
create a new project
go to the image workbench and create a image in 3d space; image is visible
go to the part design workbench and create a new sketch in the same plane as the image; the image disappears
set anti-aliasing to anything else in the configuration; the image is back again
set anti-aliasing back to none and now the image doesn't disappear again, even not if you create an other sketch

Till now, I was not able to reproduce the GL error.

In my last message I forgot to say, that I use the proprietary AMD driver at version 12.104.
jmaustpc
Posts: 10525
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Sun May 11, 2014 6:19 am

ulrich1a wrote: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
I'm not getting the error here working perfectly here on a laptop with an old Nvidia Quadro GPU and nouveau driver .I'll try it on some other pc in a bit...but here is the details for this one.

OS: Kubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3567 (Git)
Branch: master
Hash: 068452f0ac35ed9d70b250bf0ac83d91fb1c2e51
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


name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
etcetera................

client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:............etc...........


OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NV84
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 10.1.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:..blah....blah......etc...
jmaustpc
Posts: 10525
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Sun May 11, 2014 6:49 am

detlet wrote:
jmaustpc wrote:Can you post a file that demonstrates these issues?
For the disappearing images it doesn't depend on a special file. So here is, how I can reproduce it with any image:
set anti-aliasing to none in the configuration
create a new project
go to the image workbench and create a image in 3d space; image is visible
go to the part design workbench and create a new sketch in the same plane as the image; the image disappears
set anti-aliasing to anything else in the configuration; the image is back again
set anti-aliasing back to none and now the image doesn't disappear again, even not if you create an other sketch

Till now, I was not able to reproduce the GL error.

In my last message I forgot to say, that I use the proprietary AMD driver at version 12.104.
OK, thanks for the clear step by step instructions, now I can confirm that bug for me to...and add a bit more more to it.

The bug is there for "none" and "Line smoothing" modes... Like you said if you once select any of the aa modes and then go back to either none or line smoothing, the bug does not come back.

Also a variation on this bug
1) have the preference set to either "none" or "Line smoothing"
2)start FreeCAD go to PartDesign wb then image WB new document, insert image plane, select A4 landscape template from Data/mod/drawing/......you get an image plane with the drawing template
2)edit menu ..preference..display...anti-aliasing...leave the setting as whichever it was (either "none" or "Line smoothing")...keep pressing "Apply"....the image plane will change back and forth between displaying the image and a grey plane (Part colour), each time the Apply is applied.

I think these are basically the same bug...


@ickby is this something you can fix quickly or should I write up a bug report?

Jim
ickby
Posts: 2994
Joined: Wed Oct 05, 2011 7:36 am

Re: Anti-Aliasing

Postby ickby » Sun May 11, 2014 7:07 am

jim,

can you please check if this bug is in older versions too, before the anti-aliasing patch? I can't think of any reason this could have to do with my changes, if you set "None" or "Smoothing" then everything is as it was before my changes.
User avatar
detlet
Posts: 82
Joined: Sun Sep 25, 2011 5:54 pm
Location: Lauenstein, Germany

Re: Anti-Aliasing

Postby detlet » Sun May 11, 2014 9:04 am

ickby wrote:can you please check if this bug is in older versions too, before the anti-aliasing patch?
I've tested it with the version at commit http://sourceforge.net/p/free-cad/code/ ... 3b292c4cf/ - the one directly before your "Add multisampling anti-aliasing" commit - and for me that version works without any problems.
wmayer
Site Admin
Posts: 16857
Joined: Thu Feb 19, 2009 10:32 am

Re: Anti-Aliasing

Postby wmayer » Sun May 11, 2014 9:38 am

ickby wrote:jim,

can you please check if this bug is in older versions too, before the anti-aliasing patch? I can't think of any reason this could have to do with my changes, if you set "None" or "Smoothing" then everything is as it was before my changes.
I can confirm exactly this what detlet reported. After doing some experiments I found out that when I modify View3DInventorViewer::setAntiAliasingMode() to do nothing then everything works fine again,

So, setting anti-aliasing setting to "None" does not have the same effect as it was before the patch. We at least call
getGLRenderAction()->setSmoothing(false); and
setSampleBuffers(buffers);

Remark:
When a sketcher goes to edit mode than I have to revert the anti-aliasing to "None" because otherwise the box-selection is broken. See ViewProviderSketch::setEditViewer
jmaustpc
Posts: 10525
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Anti-Aliasing

Postby jmaustpc » Mon May 12, 2014 10:30 am

I am getting a horrible display when setting is either none or smooth lines, for a default Part Box and cylinder. If I go to preferences and click apply without changing the setting from either none or smooth lines, the images toggles back and forward between horrible and perfect. Repeatedly clicking apply caused a crash once but I could not yet get that crash to repeat.
screenshotdistance none-smoothlinesdisplayissue.png
screenshotdistance none-smoothlinesdisplayissue.png (169.88 KiB) Viewed 2155 times
OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3569 (Git)
Branch: master
Hash: ec442507e1a280db0ddb520ee566c788d45a7566
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


Like the last post regarding the image plane...if you once toggle an aa mode and then go back to none or smooth lines, then the bug goes away
ickby
Posts: 2994
Joined: Wed Oct 05, 2011 7:36 am

Re: Anti-Aliasing

Postby ickby » Mon May 12, 2014 10:38 am

Ok, I can reproduce the image plane and will check the black/normal behaviour too. No idea why this is happeneing, but I think we should reduce the antialisaing calls only to situations when something changes. I will test if this works.