DiscussionsIssue archiveOCCT:Visualization

Archived issue #0027735

Visualization, OpenGl_ShaderManager - fix clipping state management

Open CASCADEOCCT:Visualizationclosed25 public notes

Search issues

Description

There are several issues within clipping state tracking in OpenGl_ShaderManager:
- OpenGl_ShaderManager::UpdateClippingState() and ::RevertClippingState() are called asymmetrically leading to unlimited growth of clipping state stack and thus memory leak.
- OpenGl_CappingAlgo::RenderCapping() alters clipping plane list without updating clipping state in OpenGl_ShaderManager leading to visualization issues.
- OpenGl_Clipping::AddWorldLazy() is intended to skip uploading matrices for FFP. This optimization leads to broken planes definition in some cases and does not make much sense (AddWorldLazy() is used only to set clipping planes 2 times per frame).

Steps to reproduce

bugs/vis/bug24224

Public activity

25 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 Aug 1 22:59:41 2016 +0300

    0027735: Visualization, OpenGl_ShaderManager - fix clipping state management
    
    OpenGl_CappingAlgo::RenderCapping() now updates clipping state in Shader Manager.
    OpenGl_View::render() clipping state setup has been moved to OpenGl_View::renderScene().
    
    OpenGl_ShaderManager now converts position to homogeneous coordinates within clipping code GLSL.
    This fixes capping plane rendering with clipping planes applied.
02Author
Patch is ready for review.
03Commenter 3
Dear Commenter 1,

I have no remarks to the patch, please test it.
04Commenter 4
Dear Commenter 1,

Branch CR27735 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1124

Regressions/Differences:
Not detected

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

Testing on Linux:
Total MEMORY difference: 90117749 / 90124523 [-0.01%]
Total CPU difference: 19367.620000000003 / 19470.040000000092 [-0.53%]

Testing on Windows:
Total MEMORY difference: 57084276 / 57093912 [-0.02%]
Total CPU difference: 18202.212280098767 / 18078.831089198848 [+0.68%]

There are differences in images found by testdiff:
http://occt-tests/CR27735-master-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR27735-master-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
v3d mesh B7
bugs vis bug270_2
bugs vis bug270_1
05Commenter 5
Dear Kirill,

Branch [archived branch] has been rejected due to:
- differences in images
06Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Aug 3 15:37:14 2016 +0300

    OpenGl_ShaderManager - revert change for OccEquationCoords_View case

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

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Aug 3 15:39:07 2016 +0300

    0027735: Visualization, OpenGl_ShaderManager - fix clipping state management
    
    OpenGl_CappingAlgo::RenderCapping() now updates clipping state in Shader Manager.
    OpenGl_View::render() clipping state setup has been moved to OpenGl_View::renderScene().
    
    OpenGl_ShaderManager now converts position to homogeneous coordinates within clipping code GLSL.
    This fixes capping plane rendering with clipping planes applied.
08Author
Please check corrected patch in branch CR27735_1.
09Commenter 9
Dear Commenter 1,

Branch CR27735_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1144

Regressions/Differences:
Not detected

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

Testing on Linux:
Total MEMORY difference: 90227602 / 90104021 [+0.14%]
Total CPU difference: 19352.470000000045 / 19470.140000000094 [-0.60%]

Testing on Windows:
Total MEMORY difference: 57087337 / 57093912 [-0.01%]
Total CPU difference: 18118.08094079885 / 18078.831089198848 [+0.22%]

There are differences in images found by testdiff:
http://occt-tests/CR27735_1-master-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR27735_1-master-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
v3d mesh B7
bugs vis bug270_2
bugs vis bug270_1
10Commenter 10
Dear Kirill,

Branch [archived branch] has been rejected due to:
- differences in images
11Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Aug 4 12:45:03 2016 +0300

    fix ZClipping planes state tracking

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

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Aug 4 12:47:29 2016 +0300

    0027735: Visualization, OpenGl_ShaderManager - fix clipping state management
    
    OpenGl_CappingAlgo::RenderCapping() now updates clipping state in Shader Manager.
    OpenGl_View::render() clipping state setup has been moved to OpenGl_View::renderScene().
    
    OpenGl_ShaderManager now converts position to homogeneous coordinates within clipping code GLSL.
    This fixes capping plane rendering with clipping planes applied.
13Author
Regression should be fixed now - please test branch CR27735_2.
14Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Aug 4 12:47:29 2016 +0300

    0027735: Visualization, OpenGl_ShaderManager - fix clipping state management
    
    OpenGl_CappingAlgo::RenderCapping() now updates clipping state in Shader Manager.
    OpenGl_View::render() clipping state setup has been moved to OpenGl_View::renderScene().
    
    OpenGl_ShaderManager now converts position to homogeneous coordinates within clipping code GLSL.
    This fixes capping plane rendering with clipping planes applied.
15Author
CR27735_3 is the same as CR27735_2 rebased onto IR (trivial merge conflict).
16Commenter 2
Branch [archived branch] has been updated forcibly by Author.

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

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Aug 5 20:54:34 2016 +0300

    OpenGl_Clipping::AddWorldLazy() method has been dropped
    to avoid broken clipping planes definition within FFP enabled.

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

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Aug 5 20:58:13 2016 +0300

    0027735: Visualization, OpenGl_ShaderManager - fix clipping state management
    
    OpenGl_CappingAlgo::RenderCapping() now updates clipping state in Shader Manager.
    OpenGl_View::render() clipping state setup has been moved to OpenGl_View::renderScene().
    
    OpenGl_ShaderManager now converts position to homogeneous coordinates within clipping code GLSL.
    This fixes capping plane rendering with clipping planes applied.
    
    Fixed possible Clipping planes misconfiguration when FFP is used;
    error-prone OpenGl_Clipping::AddWorldLazy() method has been dropped.
19Author
Patch has been updated (branch CR27735_4) to fix one more detected bug (NOT a regression of previous patch).
20Commenter 20
Dear Commenter 1,

Branch CR27735_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1132

Regressions/Differences:
Not detected

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

Testing on Linux:
Total MEMORY difference: 88835913 / 88483292 [+0.40%]
Total CPU difference: 19372.410000000076 / 19249.210000000057 [+0.64%]

Testing on Windows:
Total MEMORY difference: 57138657 / 57173794 [-0.06%]
Total CPU difference: 18438.257393198823 / 18044.994472298804 [+2.18%]
21Commenter 2
Branch [archived branch] has been deleted by Participant.

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

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

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

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

[revision removed]

Related records