<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1489</bug_id>
          
          <creation_ts>2024-01-22 02:44:50 +0100</creation_ts>
          <short_desc>GraphUI Group: Resolve Performance Regression in Scene.pickShape(): Drop invisible and clipped shapes</short_desc>
          <delta_ts>2024-02-21 13:15:37 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>GraphUI</product>
          <component>Core</component>
          <version>2.6.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>805</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>5f9fb7159fa33bc979e5050d384b6939658049bd
19fac36ae64ffb219fb40449b537219d74a1f000
8bb2f6dec8ab731b07387b947715fa1959c680e4</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7050</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-22 02:44:50 +0100</bug_when>
    <thetext>After implementing Bug 1487 (Frustum Clipping/Culling) and using thousands of shapes within one Group mostly culled (outside of frustum),
overall mouse Scene.pickShape() caused tremendous lagging.

This is caused by Scene.pickShape() traversing through _all_ shapes,
rendered ones, invisible ones and culled ones.

+++

Solution is to have Scene and Group provide a pre-sorted list
of actually rendered shapes, i.e. isVisible() and not culled.

Scene.pickShape() can now use this reduced and pre-sorted list
reducing the load considerably.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7056</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-22 06:36:28 +0100</bug_when>
    <thetext>commit 5f9fb7159fa33bc979e5050d384b6939658049bd
Bug 1489 - GraphUI Group: Resolve Performance Regression in Scene.pickShape(): Drop invisible and clipped shapes

implemented as described.

+++

    Further
    - cleanup TreeTool
    
    - rename Container methods:
    -- setFrustumCullingEnabled() -&gt; setPMvCullingEnabled()
    -- isFrustumCullingEnabled() -&gt; isPMvCullingEnabled()
    
    - supply Container with
    -- isCullingEnabled()
    -- List&lt;Shape&gt; getRenderedShapes()
    -- isOutside()
    -- isOutside2()
    -- forAllRendered()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7063</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-25 08:55:56 +0100</bug_when>
    <thetext>19fac36ae64ffb219fb40449b537219d74a1f000
Scene.dispatchMouseEventPickShape(): Reuse PMVMatrix4f, Ray and Vec3f within EDT, reducing temp objects on mouse moves</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7147</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-02-21 13:15:37 +0100</bug_when>
    <thetext>commit 8bb2f6dec8ab731b07387b947715fa1959c680e4

    Bug 1489: Lock-Free Double-Buffered &apos;renderedShapes&apos; causes data-race between rendering &amp; input-edt, use synchronized tripple-buffering
    
    Tripple-buffering _almost_ produces zero data-race collisions,
    however .. it still does rarely -&gt; hence synchronize on the used ArrayList&lt;&gt;.
    This adds a minimal chance for blocking the input-EDT,
    but gives correct code &amp; results.
    
    Double-buffered &apos;renderedShapes&apos; was introduced to resolve Bug 1489
    in commit 5f9fb7159fa33bc979e5050d384b6939658049bd
    
    This solution is tested by passing &apos;-swapInterval 0&apos; via CommandlineOptions for FontView01, UIMediaGrid01 ..,
    i.e. rendering faster than picking and hence provoking the data-race condition.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>