Archived issue #0024785
Visualization - Modifying z-layers concept to gain more control over OpenGl depth buffer.
Description
OCCT has a solution for depth-related issues called priority lists (or z-layers). Unfortunately priority lists don’t have enough flexibility to handle majority of possible problems.
With this patch concept of actual layers need to be introduced. Layers still will contain priority lists.
Each layer will be able to:
• Enable / disable depth test for layer.
• Enable / disable depth write for layer.
• Enable / disable depth buffer clearing.
• Enable / disable polygon offset.
With this patch concept of actual layers need to be introduced. Layers still will contain priority lists.
Each layer will be able to:
• Enable / disable depth test for layer.
• Enable / disable depth write for layer.
• Enable / disable depth buffer clearing.
• Enable / disable polygon offset.
Additional information
To achieve desired functionality following features have been implemented:
1. OpenGL_Layer object associated to each OpenGL_PriorityList. It stores and handles options described above. It encapsulates OpenGL_PriorityList::Render in its own Render method where settings applied.
2. Method SetZLayerOption (LayerId, Graphic3d_ZLayerSettings) added to Graphic3d_GraphicDriver interface. Implementation added to OpenGl_GraphicDriver.
3. Implementation of SetZLayerOption which accesses specified OpenGL_ZLayer of every OpenGL_View added to Visual3d_ViewManager. SetZLayerOption also added to V3d_Viewer.
4. ZLayerOption getter added to Visual3d_ViewManager and V3d_Viewer. It returns Graphic3d_ZLayerSettings cached in Visual3d_ViewManager for given LayerId.
1. OpenGL_Layer object associated to each OpenGL_PriorityList. It stores and handles options described above. It encapsulates OpenGL_PriorityList::Render in its own Render method where settings applied.
2. Method SetZLayerOption (LayerId, Graphic3d_ZLayerSettings) added to Graphic3d_GraphicDriver interface. Implementation added to OpenGl_GraphicDriver.
3. Implementation of SetZLayerOption which accesses specified OpenGL_ZLayer of every OpenGL_View added to Visual3d_ViewManager. SetZLayerOption also added to V3d_Viewer.
4. ZLayerOption getter added to Visual3d_ViewManager and V3d_Viewer. It returns Graphic3d_ZLayerSettings cached in Visual3d_ViewManager for given LayerId.
Public activity
4 archived notes
Participants are labeled by their role within this record.
Dear apl,
Please take a look at current implementation.
Please take a look at current implementation.
Dear duv,
The branch is reviewed. Please proceed.
The branch is reviewed. Please proceed.
Please test as high priority -- the fix is requested for 6.7.1
Dear Commenter 2,
Branch CR24785 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
MacOS: 413 (413 on master)
products component :
Linux: 12 (12 on master)
Windows: 2 (2 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 351915368 / 352653700
Total CPU difference: 49382.940000000046 / 67343.38000000024
Testing on Windows:
Total MEMORY difference: 381247368 / 380717640
Total CPU difference: 34287.890625 / 39760.234375
There are no differences in images found by testdiff.
Branch CR24785 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
MacOS: 413 (413 on master)
products component :
Linux: 12 (12 on master)
Windows: 2 (2 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 351915368 / 352653700
Total CPU difference: 49382.940000000046 / 67343.38000000024
Testing on Windows:
Total MEMORY difference: 381247368 / 380717640
Total CPU difference: 34287.890625 / 39760.234375
There are no differences in images found by testdiff.
Related records