DiscussionsIssue archiveOCCT:Visualization

Archived issue #0027787

Visualization, TKOpenGl - Optimize rendering by additional check whether the object is fully clipped or not

Open CASCADEOCCT:Visualizationclosed14 public notes

Search issues

Description

Optimize rendering by additional check whether the object is fully clipped or not

Steps to reproduce

bugs/vis/bug27751_capping

Public activity

14 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: Wed Aug 17 17:40:37 2016 +0300

    0027787: Visualization -- Optimize rendering by additional check whether the object is fully clipped or not
02Commenter 2
Dear kgv,

Please review the patch in branch CR27787.

03Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Aug 17 17:40:37 2016 +0300

    0027787: Visualization -- Optimize rendering by additional check whether the object is fully clipped or not
04Commenter 2
Branch [archived branch] has been deleted by Author.

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

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Thu Aug 18 19:28:08 2016 +0300

    OpenGl_ShaderManager - define dedicated GLSL programs for one and two clipping planes

Author: Commenter 3
Date: Thu Aug 18 19:26:52 2016 +0300

    fix disabling and enabling planes

06Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Aug 18 19:41:05 2016 +0300

    0027787: Visualization, TKOpenGl - Optimize rendering by additional check whether the object is fully clipped or not
    
    OpenGl_Structure::Render() now checks if structure is entirely clipped to skip rendering at all,
    or entirely NOT clipped to disable clipping / capping plane.
    
    OpenGl_ShaderManager now defines dedicated GLSL programs for one and two clipping planes
    to optimize rendering on slow hardware.
07Commenter 3
Clipping on CPU side dramatically improves rendering performance of global clipping / capping plane applied on a complex scene:
- Skipping rendering of entire object is essential, when considerable part is scene is clipped (like in case of frustum culling).
- Disabling capping for objects far behind the plane dramatically reduces CPU (multiple rendering passes) and GPU usage.
  This might improve performance in 10+ times depending on scene structure and complexity.
  On test model FPS increased from 10 to 60, being highly CPU-limited in first case.

Using truncated shading program in case of single clipping plane (avoid for-loop in a fragment shader) improves rendering performance on slow hardware.
On PowerVR SGX 544MP patch increases FPS by two times (at best) in case of single clipping / capping plane.
On test model FPS increased from 14.9 to 30 for clipping (7.9 to 18.5 for capping), with 53 without clipping.

08Commenter 3
Patch is ready for testing in branch CR27787_1.
09Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
10Commenter 10
Dear Commenter 1,
Branch CR27787_1 was rebased on current master of occt git-repository.
[revision removed]
11Commenter 11
Dear Commenter 1,
Branch CR27787_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1152

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27787_1-master-OCCT/Debian70-64/bugs/vis/bug27751_capping.html
http://occt-tests/CR27787_1-master-OCCT/Windows-64-VC10/bugs/vis/bug27751_capping.html
bugs vis bug27751_capping: OK

Testing on Linux:
occt component :
Total MEMORY difference: 90213577 / 89492510 [+0.81%]
Total CPU difference: 19468.28999999995 / 19495.580000000107 [-0.14%]
products component :
Total MEMORY difference: 30074211 / 30045379 [+0.10%]
Total CPU difference: 5083.799999999969 / 5077.5199999999795 [+0.12%]

Testing on Windows:
occt component :
Total MEMORY difference: 57178209 / 57161393 [+0.03%]
Total CPU difference: 18246.610164698755 / 18084.68112669885 [+0.90%]
products component :
Total MEMORY difference: 21298922 / 21261546 [+0.18%]
Total CPU difference: 4887.46452969995 / 4849.696687599947 [+0.78%]

There are no differences in images found by testdiff.
12Commenter 12
Dear Commenter 1,
Branch CR27787_1 is TESTED.
13Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
14Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records