Bug 802 - Enhance Graph Performance w/ Text Rendering
Summary: Enhance Graph Performance w/ Text Rendering
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: graph (show other bugs)
Version: 2
Hardware: All all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks: 803
  Show dependency treegraph
 
Reported: 2013-08-05 15:33 CEST by Sven Gothel
Modified: 2015-09-27 03:15 CEST (History)
2 users (show)

See Also:
Type: FEATURE
SCM Refs:
c3621221b9a563495b4f54fe60e18e8db8cc57fb d84812b6fb398c73cb3f339ab13d74b7e6822181 34aebbf54491b8f7e98bee3f45f8b58b817a6db5 0af9df19efc3bc31beafdd63e3487b74a97c80a7
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2013-08-05 15:33:27 CEST
Text artifacts related to graph (Outlines / Vertices / TextureCoords / .. ) 
shall be cached independent of text size per font used.

Overall enhancement of text rendering performance.
Comment 1 Sven Gothel 2014-06-13 08:14:01 CEST
c3621221b9a563495b4f54fe60e18e8db8cc57fb

   Strategy Change:
      - Font.Glyph itself holds it's OutlineShape
        with it's default scaling.
        Triangulation is done only once per glyph!
    
      - A CharSequence produces a Region
        by translating and scaling each Glyphs's OutlineShape.
        This removes the need for re-triangulate - see above.
        See: TextRendererUtil
    
      - The indices of re-added Triangles are
        offset to the new vertices (FIXME, seems not be be accurate yet).
    
      - OutlineShape's vertices and triangles are reused if 'clean'.
    
      - Simplified code
    
      - Reduced copies
    
    API Changes:
      - OutlineShape, Region, ...: See above
    
      - Removed TextRenderer, GlyphShape and GlyphString: Redundant
    
      - Added TextRendererUtil to produce the Region from CharSequence

   Result:
      - Over 600 fps while changing text for each frame.
        Previously only ~60fps max.
    
    TODO:
      - Region shall not hold the triangles itself,
        but the indices instead.
        This will remove the need to swizzle w/ vertices in the Region Renderer impl
        and easies reusage of OutlineShapes.
Comment 2 Sven Gothel 2014-06-13 08:14:38 CEST
d84812b6fb398c73cb3f339ab13d74b7e6822181

   - OutlineShape
      - Add DIRTY_VERTICES bit in triangulation,
        which in turn solves the rendering artifact issue.
    
      - transformOutlines(..) -> protected
    
      - Note: Always pick triangles first, then vertices.
        The former renders vertices dirty.
    
    - Region
      - Make triangles / vertices accessible
    
      - Add 'validateIndices()' to add indices for triangles,
        code moved from the GLRegion* impl.
        Shall be refined later!
    
    - GLRegion
      - Passing 'RegionRenderer' instead of RenderState ..
        reducing argument numbers and aligning all related
        'render' methods while giving association to the RegionRenderer.
    
    - Renderer -> RegionRenderer,
      dropping 'intermediate' RegionRenderer
    
      - Dropping draw() in RegionRenderer, should be issued simply
        by GLRegion in a unique fashion.
    
    - Dropping RegionFactory
      Too simple code as-is, simply invoke in Region.create(..)
    
    - Overall:
      - Add 'final' qualifier
    
      - Remove overloaded methods
        where rither default args can be used
        or a followup method call completes the 'intention'.
Comment 3 Sven Gothel 2014-06-13 08:15:33 CEST
0af9df19efc3bc31beafdd63e3487b74a97c80a7
  Performance Note: ~800-1200 fps on uncached text line