Archived issue #0024324
Antialiasing exposes triangulation edges [on NVIDIA]
Description
When activating antialiasing the edges of the triangulation are shown. This is not desired.
Please consult the attached pictures.
Please consult the attached pictures.
Steps to reproduce
psphere b 10
vinit
vdisplay b
vfit
vsetdispmode b 1
vantialiasing 1
vinit
vdisplay b
vfit
vsetdispmode b 1
vantialiasing 1
Public activity
8 archived notes
Participants are labeled by their role within this record.
This problem might depend on the machine/graphics card: I have one PC where the effect can be observed and another one where everything is OK.
OK, after switching between the Intel and NVIDIA driver I can say the problem occurs in my case using an NVIDIA graphics card:
Draw[8]> vglinfo
OpenGL info:
GLvendor = 'NVIDIA Corporation'
GLdevice = 'Quadro K2000M/PCIe/SSE2'
GLversion = '4.4.0'
GLSLversion = '4.40 NVIDIA via Cg compiler'
GLdebug = ON
Intel driver is NOT affected:
Draw[5]> vglinfo
OpenGL info:
GLvendor = 'Intel'
GLdevice = 'Intel(R) HD Graphics 4000'
GLversion = '4.0.0 - Build 9.17.10.3040'
GLSLversion = '4.00 - Build 9.17.10.3040'
Draw[8]> vglinfo
OpenGL info:
GLvendor = 'NVIDIA Corporation'
GLdevice = 'Quadro K2000M/PCIe/SSE2'
GLversion = '4.4.0'
GLSLversion = '4.40 NVIDIA via Cg compiler'
GLdebug = ON
Intel driver is NOT affected:
Draw[5]> vglinfo
OpenGL info:
GLvendor = 'Intel'
GLdevice = 'Intel(R) HD Graphics 4000'
GLversion = '4.0.0 - Build 9.17.10.3040'
GLSLversion = '4.00 - Build 9.17.10.3040'
Dear Author,
I confirm that this problem can be reproduced at our side, too.
It seems to be an old issue with GL_POLYGON_SMOOTH which results in depth test errors on polygon boundaries and thus is not the recommended anti-aliasing method nowadays. Also the old-style OpenGL smoothing is not hardware-accelerated and thus impacts the frame rate.
Obviously, this is not a regression of OCCT 6.7.0, since the code existed for years.
With OCCT releases up to 6.7.0 it is not possible to enable or disable anti-aliasing selectively for different types of geometry using API.
However, as a workaround, I recommend you adding the following line to your environment:
set CALL_OPENGL_ANTIALIASING_MODE=1
As the result, GL_POLYGON_SMOOTH is not enabled when V3d_View::SetAntialiasingOn() is called.
Meanwhile, I have to admit that both the current way to enable/disable anti-aliasing and the current implementation of anti-aliasing could be improved, though this is a low-priority task for us:
1. The most logical way to control anti-aliasing would be to move the anti-aliasing flag from V3d_View (the global switch) to Graphic3d_Aspect* classes, so as to enable/disable anti-aliasing selectively for given type of primitives and within the given Graphic3d_Group instance(s) only and thus to have full control over the visual result and rendering performance. At this step, we can keep GL_*_SMOOTH as anti-aliasing method.
2. As the second step, something smarter and faster than just enabling GL_*_SMOOTH could be used.
E.g. setting up multi-sampling could be tried:
http://www.opengl.org/wiki/Multisampling
This would require some extra platform-specific work at 3D view initialization stage.
Alternatively, shader programs supported since OCCT 6.7.0 could be considered as a tool for anti-aliasing, though choosing a suitable algorithm might not be an easy task.
Thus if you have some time for the above-mentioned experiments, your contribution would be appreciated a lot!
I confirm that this problem can be reproduced at our side, too.
It seems to be an old issue with GL_POLYGON_SMOOTH which results in depth test errors on polygon boundaries and thus is not the recommended anti-aliasing method nowadays. Also the old-style OpenGL smoothing is not hardware-accelerated and thus impacts the frame rate.
Obviously, this is not a regression of OCCT 6.7.0, since the code existed for years.
With OCCT releases up to 6.7.0 it is not possible to enable or disable anti-aliasing selectively for different types of geometry using API.
However, as a workaround, I recommend you adding the following line to your environment:
set CALL_OPENGL_ANTIALIASING_MODE=1
As the result, GL_POLYGON_SMOOTH is not enabled when V3d_View::SetAntialiasingOn() is called.
Meanwhile, I have to admit that both the current way to enable/disable anti-aliasing and the current implementation of anti-aliasing could be improved, though this is a low-priority task for us:
1. The most logical way to control anti-aliasing would be to move the anti-aliasing flag from V3d_View (the global switch) to Graphic3d_Aspect* classes, so as to enable/disable anti-aliasing selectively for given type of primitives and within the given Graphic3d_Group instance(s) only and thus to have full control over the visual result and rendering performance. At this step, we can keep GL_*_SMOOTH as anti-aliasing method.
2. As the second step, something smarter and faster than just enabling GL_*_SMOOTH could be used.
E.g. setting up multi-sampling could be tried:
http://www.opengl.org/wiki/Multisampling
This would require some extra platform-specific work at 3D view initialization stage.
Alternatively, shader programs supported since OCCT 6.7.0 could be considered as a tool for anti-aliasing, though choosing a suitable algorithm might not be an easy task.
Thus if you have some time for the above-mentioned experiments, your contribution would be appreciated a lot!
Dear Sergey,
thank you for the hints!
Indeed, I found an old thread on the forum telling to set the "CALL_OPENGL_ANTIALIASING_MODE" for NVIDIAs in order to avoid the problem.
To tell the truth, the problem does not seem that important to me neither. I'm much more interested in the Voxel package and hope to be able to spend some time on it.
thank you for the hints!
Indeed, I found an old thread on the forum telling to set the "CALL_OPENGL_ANTIALIASING_MODE" for NVIDIAs in order to avoid the problem.
To tell the truth, the problem does not seem that important to me neither. I'm much more interested in the Voxel package and hope to be able to spend some time on it.
Anyway, thanks a lot for reporting it!
I have also created a forum thread on the collaborative development portal: http://dev.opencascade.org/index.php?q=node/901
I have also created a forum thread on the collaborative development portal: http://dev.opencascade.org/index.php?q=node/901
Is this issue still relevant as of OCCT 7.0?
Old anti-aliasing API still exists in 7.0 release and might potentially cause this kind of problems.
To avoid this, new API for MSAA management implemented in #0026711 should be used.
Thus this issue can be closed.
To avoid this, new API for MSAA management implemented in #0026711 should be used.
Thus this issue can be closed.
Dear Commenter 1,
Please close this issue, it will not be fixed, since a better anti-aliasing method is supported since OCCT 7.0.
Please close this issue, it will not be fixed, since a better anti-aliasing method is supported since OCCT 7.0.
Related records