DiscussionsIssue archiveOCCT:Visualization

Archived issue #0031579

Visualization, OpenGl_CappingAlgo - clip graphics group by bounding box

Open CASCADEOCCT:Visualizationclosed11 public notes

Search issues

Description

We have slow redraw of V3d_View when we set:
- more than 6 clipping planes,
- capping is ON for all planes,
- using object material is ON for all planes.

Especially it influences on performance on discrete video cards.

Public activity

11 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: Tue May 26 10:39:58 2020 +0300

    0031579: Visualization - OpenGl_CappingAlgo performance on some clipping planes
    
    (cherry picked from [revision removed])
02Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue May 26 10:39:58 2020 +0300

    0031579: Visualization - OpenGl_CappingAlgo performance on some clipping planes
    
    (cherry picked from [revision removed])
    (cherry picked from [revision removed])
    (cherry picked from [revision removed])
    (cherry picked from [revision removed])
03Author
Dear Kirill,
please review the patch.
Jenkins Job: http://jenkins-test-12.nnov.opencascade.com/view/CR31579-master-nds/view/ALL/

Thank you,
Natasha
04Commenter 3
General remark - it seems that structure transformation is not taken into account by new logic
(Graphic3d_Group::BoundingBox() defines local Min/Max range, while Graphic3d_Structure::BoundingBox() stores transformed AABB).

+        isClipped = true;
+        break;
+      }
+    }
+    return isClipped;

Please just return TRUE in place.

+    const Graphic3d_BndBox4f& aBoxF = theGroup->BoundingBox();

Please add IsValid() check.

Graphic3d_Vec3d ((Standard_Real )aBoxF.CornerMin().x(),
+                                                  (Standard_Real )aBoxF.CornerMin().y(),
+                                                  (Standard_Real )aBoxF.CornerMin().z()),

Please use cast constructor:
> Graphic3d_Vec3d (aBoxF.CornerMin().xyz())

(cherry picked from [revision removed])
(cherry picked from [revision removed])
(cherry picked from [revision removed])
(cherry picked from [revision removed])

Please clean up commit from service info.
05Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue May 26 10:39:58 2020 +0300

    0031579: Visualization - OpenGl_CappingAlgo performance on some clipping planes
06Author
Dear Kirill,

please, review once again.
Could you please pay attention, whether the general remark is fixed correctly.

[signature removed]Natalia
07Commenter 3
+  Standard_Boolean isGroupClipped (const Handle(Graphic3d_Group)& theGroup, const Handle(OpenGl_Context)& theContext)
+ {
+    const Graphic3d_BndBox3d& aBBox = theGroup->Structure()->CStructure()->BoundingBox();

If this AABB doesn't pass clipping test - wouldn't it be rejected earlier to not perform capping algorithm at all?
I have some doubts on usefulness of this check on group level - I think it will be necessary reevaluating performance comparison after changed logic and define some reproducible test case.
Ideally, this could be conditional by a parameter in Graphic3d_RenderingParams to be able to perform tests without rebuilding OCCT and to be able to disable optimization when it might have counter effect.

08Commenter 3
Please close this bug as it is not that trivial to implement correctly (and beneficially).
Will be considered in future as one of the ways to improve capping performance.
09Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
10Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]
11Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records