Archived issue #0032188
Visualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel
Description
Currently Graphic3d_Aspects::ToSuppressBackFaces() is defined as a Boolean value.
The meaning of this Boolean flag is confusing:
- FALSE means dualsided shading;
- TRUE means automatic backface culling enabled for Solids and disabled for Shells based on Graphic3d_Group::IsClosed() flag.
In some cases it is desired enabling backface culling regardless of closed flag.
It is proposed replacing a Boolean flag with Graphic3d_TypeOfBackfacingModel enumeration value stored as Graphic3d_Aspects::FaceCulling() property.
The meaning of this Boolean flag is confusing:
- FALSE means dualsided shading;
- TRUE means automatic backface culling enabled for Solids and disabled for Shells based on Graphic3d_Group::IsClosed() flag.
In some cases it is desired enabling backface culling regardless of closed flag.
It is proposed replacing a Boolean flag with Graphic3d_TypeOfBackfacingModel enumeration value stored as Graphic3d_Aspects::FaceCulling() property.
Steps to reproduce
v3d/glsl/pbr_spheres - assigning visualization material to XCAF document no more automatically disables backface culling for Solids.
de_mesh/gltf_read - doubleSided=FALSE is now repsected on displaying glTF files (most noticeable on de_mesh/gltf_read/cubeemb).
v3d/viewcube/style - transparent AIS_ViewCube.
de_mesh/gltf_read - doubleSided=FALSE is now repsected on displaying glTF files (most noticeable on de_mesh/gltf_read/cubeemb).
v3d/viewcube/style - transparent AIS_ViewCube.
Public activity
12 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Mar 1 23:25:21 2021 +0300
0032188: Visualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel
Graphic3d_Aspects::ToSuppressBackFaces() bool flag has been replaced by
Graphic3d_Aspects::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.
Graphic3d_TypeOfBackfacingModel_Auto corresponds to old ToSuppressBackFaces()==TRUE;
Graphic3d_TypeOfBackfacingModel_DoubleSided corresponds to old ToSuppressBackFaces()==FALSE;
Graphic3d_TypeOfBackfacingModel_BackCulled allows enabling back face culling regardless of Graphic3d_Group::IsClosed() flag.
XCAFDoc_VisMaterial::IsDoubleSided() bool flag has been replaced by
XCAFDoc_VisMaterial::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.
glTF reader now maps "doubleSided" material flag into
Graphic3d_TypeOfBackfacingModel_BackCulled (forced back face culling) and
Graphic3d_TypeOfBackfacingModel_Auto (e.g. practically doubleSided as there is no closed/open info in glTF).
glTF writer by default writes materials as "doubleSided" save the Graphic3d_TypeOfBackfacingModel_BackCulled property set
(in future, extra logic might written for automatically defining singleSided materials for Solid B-Rep objects).
[revision removed]
Detailed log of new commits:
Author: Author
Date: Mon Mar 1 23:25:21 2021 +0300
0032188: Visualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel
Graphic3d_Aspects::ToSuppressBackFaces() bool flag has been replaced by
Graphic3d_Aspects::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.
Graphic3d_TypeOfBackfacingModel_Auto corresponds to old ToSuppressBackFaces()==TRUE;
Graphic3d_TypeOfBackfacingModel_DoubleSided corresponds to old ToSuppressBackFaces()==FALSE;
Graphic3d_TypeOfBackfacingModel_BackCulled allows enabling back face culling regardless of Graphic3d_Group::IsClosed() flag.
XCAFDoc_VisMaterial::IsDoubleSided() bool flag has been replaced by
XCAFDoc_VisMaterial::FaceCulling() property defined by Graphic3d_TypeOfBackfacingModel enumeration.
glTF reader now maps "doubleSided" material flag into
Graphic3d_TypeOfBackfacingModel_BackCulled (forced back face culling) and
Graphic3d_TypeOfBackfacingModel_Auto (e.g. practically doubleSided as there is no closed/open info in glTF).
glTF writer by default writes materials as "doubleSided" save the Graphic3d_TypeOfBackfacingModel_BackCulled property set
(in future, extra logic might written for automatically defining singleSided materials for Solid B-Rep objects).
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Patch is ready for review
- OCCT: branch CR32188;
- OCC Products: branch CR32188.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32188-master-KGV/
- OCCT: branch CR32188;
- OCC Products: branch CR32188.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32188-master-KGV/
The patch was reviewed
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17744.80000000016 / 17811.87000000015 [-0.38%]
Products
Total CPU difference: 11539.9800000001 / 11543.6500000001 [-0.03%]
Windows-64-VC14:
OCCT
Total CPU difference: 19321.640625 / 19344.390625 [-0.12%]
Products
Total CPU difference: 12868.796875 / 12900.578125 [-0.25%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.
Number of compiler warnings:
No new/fixed warnings
Regressions/Differences/Improvements:
No regressions/differences
CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17744.80000000016 / 17811.87000000015 [-0.38%]
Products
Total CPU difference: 11539.9800000001 / 11543.6500000001 [-0.03%]
Windows-64-VC14:
OCCT
Total CPU difference: 19321.640625 / 19344.390625 [-0.12%]
Products
Total CPU difference: 12868.796875 / 12900.578125 [-0.25%]
Image differences :
No differences that require special attention
Memory differences :
No differences that require special attention
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records
- #0026028 · related to · closedOption for drawing MeshVS_Mesh as closed object
- #0029517 · related to · closedVisualization - introduce AlphaMode property defining alpha value handling options
- #0033056 · related to · closedVisualization - add front face culling option
- #0024521 · child of · closedVisualization - automatic back face culling is not turned on for Solids packed into compound