Archived issue #0024521
Visualization - automatic back face culling is not turned on for Solids packed into compound
Description
Automatic back face culling (V3d_View::SetBackFacingModel (Visual3d_TOBM_AUTOMATIC)) does not work for Solids packed into compound (StdPrs_ShadedShape::Add()).
Additional information
Back faces culling reduces rendered number of triangles (improve performance) and eliminates artifacts at shape boundaries. However this option might be used only for solid objects, where interior is actually should not be visible from any point of view. Automatic back-face culling mechanism is turned on by default, controlled by V3d_View::SetBackFacingModel().
The following issues have been fixed in StdPrs_ToolShadedShape::IsClosed() (used for definition of back face culling in Shaing Aspect):
- disable culling for free closed Shells (not inside the Solid) since reversed orientation of free Shell is valid case
- enable culling for Solids packed into compound
- ignore Solids with incomplete triangulation
Back face culling is now turned off at TKOpenGl level in the following cases:
- clipping/capping planes are in effect
- for translucent objects and with hatching presentation style
The following issues have been fixed in StdPrs_ToolShadedShape::IsClosed() (used for definition of back face culling in Shaing Aspect):
- disable culling for free closed Shells (not inside the Solid) since reversed orientation of free Shell is valid case
- enable culling for Solids packed into compound
- ignore Solids with incomplete triangulation
Back face culling is now turned off at TKOpenGl level in the following cases:
- clipping/capping planes are in effect
- for translucent objects and with hatching presentation style
Public activity
7 archived notes
Participants are labeled by their role within this record.
Patch is ready for review in CR24521 branch.
In addition to described problem (culling is not turned on for solids in compound) this patch also contains back-face culling disabling when clipping plane is in effect.
In addition to described problem (culling is not turned on for solids in compound) this patch also contains back-face culling disabling when clipping plane is in effect.
Dear Commenter 1,
The branch CR24521 is reviewed. No remarks.
Please test.
The branch CR24521 is reviewed. No remarks.
Please test.
Dear Commenter 1,
Branch CR24521 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 55 (55 on master)
Windows: 1 (1 on master)
products component :
Linux: 20 (20 on master)
Windows: 2 (2 on master)
Regressions/Differences:
bugs vis(004) bug23227: FAILED
http://occt-tests/CR24521-master-occt/Debian60-64/bugs/vis/bug23227.html
http://occt-tests/CR24521-master-occt/Windows-32-VC9/bugs/vis/bug23227.html
Testing cases:
Testing on Linux:
Total MEMORY difference: 358038616 / 357038992
Total CPU difference: 43800.63000000024 / 42990.21999999986
Testing on Windows:
Total MEMORY difference: 413653100 / 412391816
Total CPU difference: 29865.53125 / 32600.59375
There are not differences in images found by testdiff.
http://occt-tests/CR24521-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
http://occt-tests/CR24521-master-occt/Debian60-64/diff-Debian60-64.html
IMAGE mesh standard_shading X1: X1.png differs
IMAGE mesh standard_shading T8: T8.png differs
IMAGE mesh standard_shading X2: X2.png differs
IMAGE bugs vis bug288_5: bug288_5_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
Branch CR24521 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 55 (55 on master)
Windows: 1 (1 on master)
products component :
Linux: 20 (20 on master)
Windows: 2 (2 on master)
Regressions/Differences:
bugs vis(004) bug23227: FAILED
http://occt-tests/CR24521-master-occt/Debian60-64/bugs/vis/bug23227.html
http://occt-tests/CR24521-master-occt/Windows-32-VC9/bugs/vis/bug23227.html
Testing cases:
Testing on Linux:
Total MEMORY difference: 358038616 / 357038992
Total CPU difference: 43800.63000000024 / 42990.21999999986
Testing on Windows:
Total MEMORY difference: 413653100 / 412391816
Total CPU difference: 29865.53125 / 32600.59375
There are not differences in images found by testdiff.
http://occt-tests/CR24521-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
http://occt-tests/CR24521-master-occt/Debian60-64/diff-Debian60-64.html
IMAGE mesh standard_shading X1: X1.png differs
IMAGE mesh standard_shading T8: T8.png differs
IMAGE mesh standard_shading X2: X2.png differs
IMAGE bugs vis bug288_5: bug288_5_Driver1_Viewer1_View1.png differs
IMAGE bugs vis bug24224: bug24224_Driver1_Viewer1_View1.png differs
The following issues have been observed by tests:
- Automatic culling should probably been disabled when Solid contains not triangulated faces (mesh standard_shading X1/X2).
- Disable culling for both capping and culling (capping might be specified with translucent properties, bugs vis bug24224).
- Disable culling for Shading aspect with translucent properties (caf presentation F3/F4).
Test case mesh/standard_shading/T8 produces broken shape (Shell within Solid has wrong orientation which can be fixed by fixshape, but positive output of checkshape might be considered as additional bug).
bugs/vis/bug288_5 differs due to z-fit issues (this test case is fixed by #0024001)
- Automatic culling should probably been disabled when Solid contains not triangulated faces (mesh standard_shading X1/X2).
- Disable culling for both capping and culling (capping might be specified with translucent properties, bugs vis bug24224).
- Disable culling for Shading aspect with translucent properties (caf presentation F3/F4).
Test case mesh/standard_shading/T8 produces broken shape (Shell within Solid has wrong orientation which can be fixed by fixshape, but positive output of checkshape might be considered as additional bug).
bugs/vis/bug288_5 differs due to z-fit issues (this test case is fixed by #0024001)
Updated patch is ready for review in CR24521_1 branch (CR24521 contains history).
Dear Commenter 1.
The branch CR24521_1 is reviewed,
please test.
The branch CR24521_1 is reviewed,
please test.
Dear Commenter 1,
Branch CR24521_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 54 (55 on master)
Windows: 1 (1 on master)
products component :
Linux: 20 (20 on master)
Windows: 2 (2 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 358085764 / 357062448
Total CPU difference: 41731.36999999996 / 42989.819999999854
Testing on Windows:
Total MEMORY difference: 413540996 / 412457984
Total CPU difference: 31390.5 / 32601.609375
There are following differences in images found by testdiff.
http://occt-tests/CR24521-1-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR24521-1-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE mesh standard_shading X1: X1.png differs
IMAGE mesh standard_shading T8: T8.png differs
IMAGE bugs vis bug288_5: bug288_5_Driver1_Viewer1_View1.png differs
Branch CR24521_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 54 (55 on master)
Windows: 1 (1 on master)
products component :
Linux: 20 (20 on master)
Windows: 2 (2 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 358085764 / 357062448
Total CPU difference: 41731.36999999996 / 42989.819999999854
Testing on Windows:
Total MEMORY difference: 413540996 / 412457984
Total CPU difference: 31390.5 / 32601.609375
There are following differences in images found by testdiff.
http://occt-tests/CR24521-1-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR24521-1-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html
IMAGE mesh standard_shading X1: X1.png differs
IMAGE mesh standard_shading T8: T8.png differs
IMAGE bugs vis bug288_5: bug288_5_Driver1_Viewer1_View1.png differs
Related records
- #0023191 · related to · closedVisualization - small objects displayed with visual artifacts
- #0032188 · parent of · closedVisualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel
- #0024531 · related to · closedCheck shape does not report invalid orientation of Shells within Solid
- #0023235 · related to · closedThe inner side of an AIS_Shape not rendered when activated clipping plane
- #0024672 · related to · closedVisualization - AIS_TexturedShape does not activate back face culling aspect
- #0024706 · related to · closedSolids produced by BOP do not have flag Closed set in shells
- #0025134 · related to · assignedExtended mode for checkshape command
- #0025687 · related to · closedVisualization, XCAF - eliminate visual artifacts at the edges of faces