View Issue Details

IDProjectCategoryView StatusLast Update
0024224Open CASCADEOCCT:Visualizationpublic2013-12-19 13:58
ReporterdbpAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.7.0 
Target Version6.7.0Fixed in Version6.7.0 
Summary0024224: Suspicious logics in changing clipping planes at OpenGl_Structure
DescriptionThe following piece of code seems to produce bugs for crossing lists of clippings between view and structure:

void OpenGl_Structure::Render(..)
{
..

  // Collect planes which should be turned on for structure
  Graphic3d_SetOfHClipPlane aPlanesOn;
  Graphic3d_SetOfHClipPlane::Iterator aPlaneIt (myClipPlanes);
  for (; aPlaneIt.More(); aPlaneIt.Next())
  {
    const Handle(Graphic3d_ClipPlane)& aUserPln = aPlaneIt.Value();
    if (aUserPln->IsOn())
      aPlanesOn.Add (aUserPln);
  }

  // Set structure clipping planes
  if (aPlanesOn.Size() > 0)
  {
    aContext->ChangeClipping().Set (aPlanesOn, AWorkspace->ViewMatrix());
  }

 ... unset would remove the planes in case of crossing lists

  // unset structure clipping planes
  if (aPlanesOn.Size() > 0)
  {
    aContext->ChangeClipping().Unset (aPlanesOn);
  }

...

}

Provide stencil buffer for 3D viewer image dump functionality.
Steps To Reproducepload AISV MODELING
vinit
box b1 0 0 0 10 10 10
box b2 30 0 0 10 40 10
box b3 -30 0 0 20 20 20
vsetdispmode 1
vdisplay b1 b2 b3
## test view-level clipping
vclipplane create pln1
vclipplane change pln1 equation 0 1 0 -5
vclipplane change pln1 capping on
vclipplane change pln1 capping color 0.9 0.9 0.9
vclipplane set pln1 view Driver1/Viewer1/View1
## test sharing of planes between view and object
vclipplane set pln1 object b1
## test object-level clipping
vclipplane create pln2
vclipplane change pln2 equation -0.707 0.707 0 -25
vclipplane change pln2 capping on
vclipplane change pln2 capping color 0.5 0.5 0.9
vclipplane change pln2 capping hatch on
vclipplane set pln2 object b3
vfit
Additional information
and documentation updates
This patch contains solution for several issues:
1) The reported problem dedicated to suspicious operations which activating/deactivating list of clip planes during rendering. Due to logical mistake a set of clip planes, shared between view and more than one structure, was not applied completely for second and the latter structures (numeration here corresponds to position of structures in rendering pipeline) - the clip planes of view were not accounted for these structures.

2) The patch contains solution for issues 0024189, 0024229. All these issues are interrelated and have cross-dependencies.

3) Missed test case for checking OpenGl-rendered cappings (issue #0024070) is added by this patch.

Changes:

- No changes to public API.
- Internal changes:
  a) Added support for stencil buffer
     OpenGl_FrameBuffer.hxx
     OpenGl_FrameBuffer.cxx
     OpenGl_FrameBuffer::Init (...)

  b) Improved interface of clip plane state management to avoid performance regressions; fixed code remarks.
  c) Problem with clip planes sharing between view and structures has been fixed
     OpenGl_ClipPlaneState.cxx
     OpenGl_ClipPlaneState.hxx
     OpenGl_Structure.cxx
     OpenGl_Structure::Render (...)
TagsNo tags attached.
Test case numberbugs vis bug24224

Attached Files

  • 24224.png (62,784 bytes)

Relationships

related to 0024189 closedapl Open CASCADE Rendering performance regression after implementation of per-object clipping 
related to 0024229 closedapl Open CASCADE Test case for 0024070 bug has not been integrated 
related to 0024253 closedbugmaster Open CASCADE FBO: Improper deletion of combined Stencil+Depth RenderBuffer 

Activities

dbp

2013-10-04 19:04

developer   ~0025911

Dear apl,

Could you please check this issue?

apl

2013-10-08 14:32

developer  

24224.png (62,784 bytes)

apl

2013-10-08 14:42

developer   ~0025957

Dear kgv,

Branch CR24224 is ready for review.

Could you please have a look at it?

apl

2013-10-08 16:22

developer   ~0025969

This fix introduces solution for issue 24189.

The results prior to patch with capping & clipping (0024070):

Highest CPU performance:
FPS: 57.575139198577126
CPU: 16.380105 msec

Lowest CPU performance:
FPS: 57.685042823789502
CPU: 16.692107000000007 msec

The results after patch:

Highest CPU performance:
FPS: 58.110396973959986
CPU: 16.380105 msec

Lowest CPU performance:
FPS: 57.958128763574308
CPU: 16.848108000000011 msec

Performance compared on card: NVIDIA Quadro K4000, CPU: Core i5-3450

kgv

2013-10-08 17:16

developer   ~0025974

Patch has been reviewed without remarks and ready for testing.

apn

2013-10-10 10:31

administrator   ~0026010

Dear BugMaster,

Branch CR24224 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: a481bc96baeed9a47018a608753dd26970f7d345

Number of compiler warnings:

occt component :
Linux: 424 (424 on master)
Windows: 9 (9 on master)

products component :
Linux: 189 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
bugs vis bug24224 - OK

Testing on Linux:
Total MEMORY difference: 367428100 / 367264668
Total CPU difference: 43704.150000001275 / 44590.37000000126

Testing on Windows:
Total MEMORY difference: 431925044 / 433307988
Total CPU difference: 51473.28125 / 41888.375

There are not differences in images found by testdiff.

kgv

2013-10-11 10:39

developer   ~0026040

+    if (!theGlContext.IsNull() && theGlContext->extFBO != NULL)
+    {
+      theGlContext->extFBO->glDeleteRenderbuffersEXT (1, &myGlStencilRBId);
+      myGlStencilRBId = NO_RENDERBUFFER;
+    }

Deletion of combined Stencil+Depth RenderBuffer will be performed twice which might lead to issues within some OpenGL implementations.

Related Changesets

occt: master b859a34d

2013-10-10 13:14:52

apl


Committer: bugmaster Details Diff
0024224: Suspicious logics in changing clipping planes at OpenGl_Structure

1) Resolved buggy situation of shared clip planes between view and structure;
2) Added clipping plane equation space identification - to be used with shaders;
3) Code refactoring to resolve performance issue reported by 0024189;
4) Attachment of stencil buffer to FBO.

Added test case bugs/vis/bug24224
Affected Issues
0024224
mod - src/Graphic3d/FILES Diff File
mod - src/Graphic3d/Graphic3d_ClipPlane.hxx Diff File
add - src/Graphic3d/Graphic3d_SetOfHClipPlane_Handle.hxx Diff File
mod - src/OpenGl/OpenGl_CappingAlgo.cxx Diff File
mod - src/OpenGl/OpenGl_ClippingState.cxx Diff File
mod - src/OpenGl/OpenGl_ClippingState.hxx Diff File
mod - src/OpenGl/OpenGl_Context.cxx Diff File
mod - src/OpenGl/OpenGl_Context.hxx Diff File
mod - src/OpenGl/OpenGl_FrameBuffer.cxx Diff File
mod - src/OpenGl/OpenGl_FrameBuffer.hxx Diff File
mod - src/OpenGl/OpenGl_Structure.cxx Diff File
mod - src/OpenGl/OpenGl_Structure.hxx Diff File
mod - src/OpenGl/OpenGl_View_2.cxx Diff File
add - tests/bugs/vis/bug24224 Diff File

Issue History

Date Modified Username Field Change
2013-10-04 19:04 dbp New Issue
2013-10-04 19:04 dbp Assigned To => apl
2013-10-04 19:04 dbp Note Added: 0025911
2013-10-04 19:04 dbp Status new => assigned
2013-10-07 09:00 apl Relationship added related to 0024189
2013-10-08 12:26 apl Steps to Reproduce Updated
2013-10-08 14:01 apl Relationship added related to 0024229
2013-10-08 14:03 apl Steps to Reproduce Updated
2013-10-08 14:32 apl File Added: 24224.png
2013-10-08 14:42 apl Note Added: 0025957
2013-10-08 14:42 apl Assigned To apl => kgv
2013-10-08 14:42 apl Status assigned => resolved
2013-10-08 16:22 apl Note Added: 0025969
2013-10-08 17:16 kgv Note Added: 0025974
2013-10-08 17:16 kgv Assigned To kgv => bugmaster
2013-10-08 17:16 kgv Status resolved => reviewed
2013-10-09 07:35 apl Assigned To bugmaster => mkv
2013-10-09 08:24 kgv Additional Information Updated
2013-10-10 10:31 apn Note Added: 0026010
2013-10-10 10:31 apn Test case number => bugs vis bug24224
2013-10-10 10:31 apn Assigned To mkv => bugmaster
2013-10-10 10:31 apn Status reviewed => tested
2013-10-11 10:39 kgv Note Added: 0026040
2013-10-11 11:06 apl Relationship added related to 0024253
2013-10-11 13:35 bugmaster Changeset attached => occt master b859a34d
2013-10-11 13:35 bugmaster Status tested => verified
2013-10-11 13:35 bugmaster Resolution open => fixed
2013-10-17 11:18 apl Description Updated
2013-10-17 11:18 apl Additional Information Updated
2013-10-17 11:23 apl Additional Information Updated
2013-10-17 11:23 apl Additional Information Updated
2013-10-17 11:27 apl Additional Information Updated
2013-10-19 21:46 apl Additional Information Updated
2013-10-19 21:46 apl Additional Information Updated
2013-12-19 13:51 bugmaster Status verified => closed
2013-12-19 13:58 bugmaster Fixed in Version => 6.7.0