DiscussionsIssue archiveOCCT:Visualization

Archived issue #0032188

Visualization, Graphic3d_Aspects - define backface culling using Graphic3d_TypeOfBackfacingModel

Open CASCADEOCCT:Visualizationclosed12 public notes

Search issues

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.

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.

Public activity

12 archived notes

Participants are labeled by their role within this record.

01Commenter 2
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).
02Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
03Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
04Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
05Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
06Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
07Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
09Author
Patch is ready for review
- OCCT: branch CR32188;
- OCC Products: branch CR32188.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32188-master-KGV/
10Commenter 10
The patch was reviewed
11Commenter 1
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
12Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records