MantisBT - Open CASCADE
View Issue Details
0025675Open CASCADE[OCCT] OCCT:Visualizationpublic2014-12-29 16:062015-10-16 16:37
dbp 
bugmaster 
normalminor 
closedfixed 
[OCCT] 6.8.0 
[OCCT] 6.9.0[OCCT] 6.9.0 
Not needed
0025675: Visualization - Fix problems and inefficiencies with frustum culling
Potential problems in method:

OpenGl_BVHTreeSelector::Intersect (const OpenGl_Vec4& theMinPt, const OpenGl_Vec4& theMaxPt)

There are a few places like this:

aFrustumProjMax = myMaxOrthoProjectionPts[0] - DotProduct (OpenGl_Vec4 (1.0f, 0.0f, 0.0f, 1.0f), theMinPt);
aFrustumProjMin = myMinOrthoProjectionPts[0] - DotProduct (OpenGl_Vec4 (1.0f, 0.0f, 0.0f, 1.0f), theMinPt);

In such places homogenios coords are used, thus SAT directions must have W = 0 (not 1.0):

DotProduct (OpenGl_Vec4 (1.0f, 0.0f, 0.0f, 0.0f), theMinPt)

This leads to diffierent result of DOT functiom (extra 1.0).

Moreover, it is inefficient to use DOT here, because

DOT (vec (1, 0, 0, 0), V) = V.x
DOT (vec (0, 1, 0, 0), V) = V.y
DOT (vec (0, 0, 1, 0), V) = V.z

So it is better to eliminate all DOTs to achieve higher performance.

Another shadow point is in traverse function:

      if (theSelector.Intersect (aBVHTree->MinPoint (aNode),
                                 aBVHTree->MaxPoint (aNode)))
      {
        Standard_Integer aIdx = aBVHTree->BegPrimitive (aNode);
        myBVHPrimitives.GetStructureById (aIdx)->MarkAsNotCulled();
        if (aHead < 0)
        {
          return;
        }

        aNode = aStack[aHead];
        --aHead;
      }

Why do we need to ckeck intersection here? All intersections were checked on previous steps.
not required
No tags attached.
related to 0024307closed apn Open CASCADE TKOpenGl - efficient culling of large number of presentations 
related to 0025768closed bugmaster Open CASCADE Visualization, Graphic3d_Structure - do not use invalid bounding boxes of empty groups 
related to 0025853closed bugmaster Community Edges disappear or reappear when displaying new edges 
xls BVH_culling_performance.xls (58,368) 2015-01-27 19:05
https://tracker.dev.opencascade.org/
xls BVH_culling_performance_upd.xls (64,512) 2015-02-04 12:17
https://tracker.dev.opencascade.org/
Issue History
2014-12-29 16:06dbpNew Issue
2014-12-29 16:06dbpAssigned To => kgv
2014-12-29 16:11kgvAssigned Tokgv => vpa
2014-12-29 16:11kgvAssigned Tovpa => san
2014-12-29 16:11kgvAssigned Tosan => kgv
2014-12-29 16:12kgvRelationship addedrelated to 0024307
2014-12-29 21:47kgvRelationship addedrelated to 0025679
2015-01-12 10:24kgvAssigned Tokgv => vpa
2015-01-12 10:24kgvStatusnew => assigned
2015-01-12 18:11gitNote Added: 0035973
2015-01-23 12:17gitNote Added: 0036432
2015-01-27 14:50gitNote Added: 0036709
2015-01-27 19:05vpaFile Added: BVH_culling_performance.xls
2015-01-27 19:14gitNote Added: 0036738
2015-01-27 19:14vpaNote Added: 0036739
2015-01-27 19:14vpaAssigned Tovpa => dbp
2015-01-27 19:14vpaStatusassigned => resolved
2015-01-27 19:14vpaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9178#r9178
2015-01-30 12:32kgvRelationship addedrelated to 0025768
2015-01-30 12:38kgvProduct Version6.9.0 => 6.8.0
2015-01-30 12:38kgvTarget VersionUnscheduled => 6.9.0
2015-01-30 12:42szvSummaryVisaulization - Fix problems and inefficiencies with frustum culling => Visualization - Fix problems and inefficiencies with frustum culling
2015-01-30 13:15dbpAssigned Todbp => vpa
2015-01-30 13:15dbpStatusresolved => assigned
2015-01-30 14:24gitNote Added: 0036893
2015-01-30 15:34gitNote Added: 0036902
2015-02-04 11:40gitNote Added: 0037046
2015-02-04 12:17vpaFile Added: BVH_culling_performance_upd.xls
2015-02-04 12:18vpaNote Added: 0037048
2015-02-04 12:18vpaAssigned Tovpa => dbp
2015-02-04 12:18vpaStatusassigned => resolved
2015-02-04 13:40gitNote Added: 0037062
2015-02-04 13:42dbpNote Added: 0037063
2015-02-04 13:42dbpAssigned Todbp => bugmaster
2015-02-04 13:42dbpStatusresolved => reviewed
2015-02-04 16:00gitNote Added: 0037077
2015-02-04 17:27mkvAssigned Tobugmaster => mkv
2015-02-05 13:16mkvNote Added: 0037111
2015-02-05 13:16mkvAssigned Tomkv => bugmaster
2015-02-05 13:16mkvStatusreviewed => tested
2015-02-05 13:16mkvTest case number => Not needed
2015-02-06 15:38bugmasterChangeset attached => occt master 14a35e5d
2015-02-06 15:38bugmasterStatustested => verified
2015-02-06 15:38bugmasterResolutionopen => fixed
2015-02-13 10:28gitNote Added: 0037483
2015-02-24 08:59kgvRelationship addedrelated to 0025853
2015-05-14 15:29aivStatusverified => closed
2015-05-14 15:32aivFixed in Version => 6.9.0
2015-10-09 16:04gitNote Added: 0046632
2015-10-16 16:37gitNote Added: 0046967

Notes
(0035973)
git   
2015-01-12 18:11   
Branch CR25675 has been created by vpa.

SHA-1: 385adf0d664ee9592daf5457cee5c65471ab5e46


Detailed log of new commits:

Author: vpa
Date: Mon Jan 12 18:08:42 2015 +0300

    0025675: Visaulization - Fix problems and inefficiencies with frustum culling
    
    Removed unnecessary overlap check in traverse of priority list items;
    Slight optimization of calculations in overlap detection methods in OpenGl_BVHTreeSelector
(0036432)
git   
2015-01-23 12:17   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: 90a68473fde6e1dbbd4ed176d815a53a3faf1e03
(0036709)
git   
2015-01-27 14:50   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: 3d20217cc4c8675091704a9ba20fd334e982602b
(0036738)
git   
2015-01-27 19:14   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: f4838959042f7593efec3876c85e61ea419ddd73
(0036739)
vpa   
2015-01-27 19:14   
Dear Denis,

the patch in branch CR25675 is ready to be reviewed.

For performance comparsion results please see the attached file BVH_culling_performance.xls.
(0036893)
git   
2015-01-30 14:24   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: b808a92dc1aea25028978eb45d2d571ea6d78d61
(0036902)
git   
2015-01-30 15:34   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: 2ccf863bfcb49886b1c4ac8bb47f81b279938ca0
(0037046)
git   
2015-02-04 11:40   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: ef27ec5e83f56c6e90e03cae95964ef54a8e5ffb
(0037048)
vpa   
2015-02-04 12:18   
Dear Denis,

the patch in branch CR25675 was corrected according to your remarks and is ready to be reviewed.

For new performance comparsion results please see the attached file BVH_culling_performance_upd.xls.
(0037062)
git   
2015-02-04 13:40   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: 00861ddda5097bb6a5bdb35768dee7728b5d7839
(0037063)
dbp   
2015-02-04 13:42   
Dear bugmaster,

please test the patch.
(0037077)
git   
2015-02-04 16:00   
Branch CR25675 has been updated forcibly by vpa.

SHA-1: ebef1bc61408b6375b308957674551c111a46721
(0037111)
mkv   
2015-02-05 13:16   
Dear BugMaster,
Branch CR25675 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: ebef1bc61408b6375b308957674551c111a46721

Number of compiler warnings:

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

products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 369741952 / 370076844
Total CPU difference: 54165.1500000001 / 49863.81000000002
products component :
Total MEMORY difference: 110349192 / 110236384
Total CPU difference: 15863.469999999978 / 15774.329999999973

Testing on Windows:
occt component :
Total MEMORY difference: 276104008 / 276284192
Total CPU difference: 34660.28125 / 36894.109375
products component :
Total MEMORY difference: 53810528 / 53717872
Total CPU difference: 8116.5 / 10071.46875

There are no differences in images found by testdiff.
(0037483)
git   
2015-02-13 10:28   
Branch CR25675 has been deleted by kgv.

SHA-1: ebef1bc61408b6375b308957674551c111a46721
(0046632)
git   
2015-10-09 16:04   
Branch CR25675_2 has been created by nbv.

SHA-1: 4fd36f5053e21c0092c7ba624afb3d14a36d1655


Detailed log of new commits:

Author: nbv
Date: Fri Oct 9 13:28:20 2015 +0300

    0026675: Eliminate normalization of coordinates in ApproxInt package
    
    Normalization has been eliminated.
    
    Additionally,
    1. Some methods of AppDef_Compute and ApproxInt_MultiLine classes have become inline (for speeding up performance).
    2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed.
    3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more).
    4. Lost comments have been added in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files.
    5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant.
    6. Interface of ksection DRAW-command has been changed.
    7. Some code fragments have been rewritten to make them easier.
    8. Function CleanWline(...) has been added in IntPatch_Intersection.cxx file. See comments in code for detail description.
    
    Adjusting some test case according to their new behavior.
(0046967)
git   
2015-10-16 16:37   
Branch CR25675_2 has been deleted by kgv.

SHA-1: 4fd36f5053e21c0092c7ba624afb3d14a36d1655