<?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>1487</bug_id>
          
          <creation_ts>2024-01-20 05:19:17 +0100</creation_ts>
          <short_desc>Graph: Use Frustum Clipping instead of AABBox + GraphUI Support</short_desc>
          <delta_ts>2024-01-20 05:44:08 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>graph</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>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>805</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs>1040bed4ecc6f4598ea459f1073a9240583fc3c3
5cca51e32999a882e2a5f00cb45ecafc824ffd86
c1531c3d99b19032040018b9414263b0d3000147</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>7041</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-20 05:19:17 +0100</bug_when>
    <thetext>AABBox clipping naturally couldn&apos;t be transformed into 3D Model-View (Mv) Space,
as it is axis aligned and only provided 2 points (min/max).
    
Therefor we map the Group&apos;s AABBox to a 8-point Cube,
perform the Mv-transformation and then produce the 6-plane Frustum.
    
As before, we cull fully outside shapes within the Group&apos;s draw method
and perform fragment clipping with same Frustum planes in the shader.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7042</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-20 05:22:18 +0100</bug_when>
    <thetext>commit 1040bed4ecc6f4598ea459f1073a9240583fc3c3

Add Cube to Frustum Plane mapping, supporting transformation of object-space AABBox into model-view Cube to Frustum.Plane for culling (cpu) and clipping (gpu)

+++

commit 5cca51e32999a882e2a5f00cb45ecafc824ffd86

Frustum: Revise code and its Plane definition to support Cube-&gt;Frustum as well as to extract planes for float[] vec4-shader uniforms.
    
commit 1040bed4ecc6f4598ea459f1073a9240583fc3c3 added AABBox -&gt; Cube -&gt; Frustum mapping (incomplete)
and requires Frustum.Plane.set(..) by normal and point-on-plane for distance.
    
Frustum.isOutside(Cube) has been added, testing all its 8-points similar to AABBox.
    
Further all 6 Frustum.Plane shall be extracted to Vec4f and float[],
the latter to pass the whole float[4*6] as a vec4[6] uniform array to the shader.
    
    
Constructor, setter and getter have been adjusted accordingly.
    
Most of the loops have been unrolled.

    
Method names to query Frustum, i.e. &apos;is*Outside(&lt;Type&gt;)&apos;
have been reduced to &apos;isOutside(&lt;Type&gt;)&apos;
where &lt;Type&gt; uniquely indenticates the purpose.
Hence only &apos;isSphereOutside()&apos; is left over.

+++

commit c1531c3d99b19032040018b9414263b0d3000147

Graph Clipping: Use Frustum Clipping using AABBox -&gt; Mv transformed Cube -&gt; Frustum mapping + GraphUI Support
    
AABBox clipping naturally couldn&apos;t be transformed into 3D Model-View (Mv) Space,
as it is axis aligned and only provided 2 points (min/max).
    
Therefor we map the Group&apos;s AABBox to a 8-point Cube,
perform the Mv-transformation and then produce the 6-plane Frustum.
    
As before, we cull fully outside shapes within the Group&apos;s draw method
and perform fragment clipping with same Frustum planes in the shader.
    
With clipping enabled, the 3D z-axis getBounds() depth
will be slightly increased for functional Frustum operation.
This is also done for setFixedSize(Vec2f).
    
The Frustum planes are copied to the Graph shader
via float[4*6] -&gt; uniform vec4  gcu_ClipFrustum[6]; // L, R, B, T, N, F each {n.x, n.y, n.z, d}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7047</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-20 05:43:26 +0100</bug_when>
    <thetext>Screenshot w/ debug code demonstrating the Frustum clipping w/ rotation.
The red-part is clipped by the shader, while the other thousand Glyphs
of that glyph-grid are culled by the Group.

https://jogamp.org/bugzilla//show_bug.cgi?id=805#c17</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7048</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2024-01-20 05:44:08 +0100</bug_when>
    <thetext>(In reply to Sven Gothel from comment #2)
(wrong link)
https://jausoft.com/blog/wp-content/uploads/2024/01/FontView01-norm-q1-s01-fsaa4-FreeSerif_Regular_cp106-snap04-1280x0720-1.png</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>