Anti-Aliasing
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Anti-Aliasing
Hello,
for quite some time I'm unsatisfied with the possible anti-aliasing, which looks like this for me: Bassicly it uses openGL line and vertex smoothing which works well for sinlge lines (e.g. the grid). However, lines on shapes have a very ugly white border (e.g. cube). Additionaly, shape borders whithout edges are not anti-aliased (e.g. cylinder).
So I digged into Anti-Aliasing and openGL just to find out that the more advanced stuff is already possible in Coin. Here the same scene with multipass (4x) enabled: The edges look very good, but the color loss is annoying. Then there is multisampling (which actually already is implemented in FreeCAD, just not exposed in the preference dialog): I propose to add the multisampling (with different passes, 2x,4x,8x) to the preferences as alternative to the current smoothing which should stay as it is the fasted. Multipass can be omitted as noone is going to use it. I would implement a dropdownbox with all options, what do you think? I can provide a pathc with the rather smaller changes once we agreed on the best options.
for quite some time I'm unsatisfied with the possible anti-aliasing, which looks like this for me: Bassicly it uses openGL line and vertex smoothing which works well for sinlge lines (e.g. the grid). However, lines on shapes have a very ugly white border (e.g. cube). Additionaly, shape borders whithout edges are not anti-aliased (e.g. cylinder).
So I digged into Anti-Aliasing and openGL just to find out that the more advanced stuff is already possible in Coin. Here the same scene with multipass (4x) enabled: The edges look very good, but the color loss is annoying. Then there is multisampling (which actually already is implemented in FreeCAD, just not exposed in the preference dialog): I propose to add the multisampling (with different passes, 2x,4x,8x) to the preferences as alternative to the current smoothing which should stay as it is the fasted. Multipass can be omitted as noone is going to use it. I would implement a dropdownbox with all options, what do you think? I can provide a pathc with the rather smaller changes once we agreed on the best options.
Re: Anti-Aliasing
Coming at this from a user standpoint, I think anything that helps to improve the visual aspect of FreeCAD can only be a good thing for the project, especially for the new / casual user. There was another topic started by jriegel - Mirror bottom in Z- that discussed some of the not used features of Coin. I sure wouldn't mind seeing this, that, and some of the other stuff like advanced lighting and shadows, etc. added to FreeCAD.
At any rate, this looks like a good starting point to me.
+1
Mark
Edit - Do you have a current branch that can be pulled for testing?
At any rate, this looks like a good starting point to me.
+1
Mark
Edit - Do you have a current branch that can be pulled for testing?
This post made with 0.0% Micro$oft products - GOT LINUX?
-
- Posts: 395
- Joined: Fri Oct 07, 2011 8:58 pm
- Location: Beaverton,Oregon, USA
- Contact:
Re: Anti-Aliasing
Pimp my FreeCAD!
Re: Anti-Aliasing
Any idea whether it's possible to improve some transparency bugs as shown here? viewtopic.php?f=3&t=6037&hilit=transparency
Re: Anti-Aliasing
Hi Ickby
this would be a nice improvement.
How much effect would this have on speed, with complicated models? What effect on minimum hardware requirements? I think any GPU from the last 15 years would cope with this, am I right?
Is this something that would benefit from multi-threading with TBB in OCE?
Will this allow us to set the tessellation value to a larger number but still get good looking curves?
Jim
this would be a nice improvement.
How much effect would this have on speed, with complicated models? What effect on minimum hardware requirements? I think any GPU from the last 15 years would cope with this, am I right?
Is this something that would benefit from multi-threading with TBB in OCE?
Will this allow us to set the tessellation value to a larger number but still get good looking curves?
I was going to ask that as well.wmayer wrote:Any idea whether it's possible to improve some transparency bugs as shown here? viewtopic.php?f=3&t=6037&hilit=transparency
Jim
Re: Anti-Aliasing
Hello,
thanks for the feedback, I'm going to provide a patch.
@Werner:
in
the trancperency renders nicely. Now I can't oversee the whole impact of that change (as I'm not sure what get's drawn in the frontroot node) so I can not provide a fix. But maybe this information gives you some hints for solving this.
thanks for the feedback, I'm going to provide a patch.
It will definitly put some strain on the hardware, but therefore it is optional and old cards will go fine without it. The Multisampling is a Hardware anti-aliasing method, so it will highly depend on your card. My home nvidia has no problems with the example scene and 8 passes, my work-notebook with intel card went down with 4 passes. So thisis something for the guys with big computing power, but still nice to have.How much effect would this have on speed, with complicated models? What effect on minimum hardware requirements? I think any GPU from the last 15 years would cope with this, am I right?
No, this is entirly done on the rendered scene right inside the graphics card, it has nothing to do with the tesselation.Is this something that would benefit from multi-threading with TBB in OCE?
No, all it does is to make look straight lines not grainy but smooth. So if occ tesselates a circle with 3 edges, the 3 edges will look smooth but the circle ist still a triangle, a nice looking one thought.Will this allow us to set the tessellation value to a larger number but still get good looking curves?
@Werner:
It lookes like the transperency render order or some depth values are wrong, and after some diging into it the problem seems to be that FreeCAD View3dInventorViewer messes with the zbuffer while rendering. If you comment out all calls toAny idea whether it's possible to improve some transparency bugs as shown here?
Code: Select all
glDepthRange
Code: Select all
void View3DInventorViewer::renderScene(void)
Re: Anti-Aliasing
Great, I'll have a look at it tomorrow to see how it looks like.ickby wrote:@Werner:It lookes like the transperency render order or some depth values are wrong, and after some diging into it the problem seems to be that FreeCAD View3dInventorViewer messes with the zbuffer while rendering. If you comment out all calls toAny idea whether it's possible to improve some transparency bugs as shown here?inCode: Select all
glDepthRange
the trancperency renders nicely. Now I can't oversee the whole impact of that change (as I'm not sure what get's drawn in the frontroot node) so I can not provide a fix. But maybe this information gives you some hints for solving this.Code: Select all
void View3DInventorViewer::renderScene(void)
Re: Anti-Aliasing
Yes, disabling the glDepthRange does the trick. Apparently the changes were made to allow to increase the performance for the highlighting of the SoFCSelection node:
http://free-cad.svn.sourceforge.net/vie ... 88&r2=2648
http://free-cad.svn.sourceforge.net/vie ... 48&r2=2649
The two changes give this change:
http://free-cad.svn.sourceforge.net/vie ... 88&r2=2649
Now the SoFCSelection node has been almost replaced by SoFCUniqueSelection where we don't need the performance boost of SoFCSelection any more because the part shapes now only use a single shape node for all its faces, edges and vertexes instead of an own one for each sub-element.
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.
http://free-cad.svn.sourceforge.net/vie ... 88&r2=2648
http://free-cad.svn.sourceforge.net/vie ... 48&r2=2649
The two changes give this change:
http://free-cad.svn.sourceforge.net/vie ... 88&r2=2649
Now the SoFCSelection node has been almost replaced by SoFCUniqueSelection where we don't need the performance boost of SoFCSelection any more because the part shapes now only use a single shape node for all its faces, edges and vertexes instead of an own one for each sub-element.
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.