Class DepthPeelingRenderer3d

  • All Implemented Interfaces:
    com.jogamp.opengl.GLEventListener, EventListener

    public class DepthPeelingRenderer3d
    extends AWTRenderer3d
    Execute depth peeling methods in a Jzy3d Renderer3d This feature is based on Order Independent Transparency algorithms published by Louis Bavoil (NVIDIA Corporation). The renderer support 4 methods:
    • Dual depth peeling (accurate)
    • Front to back peeling (accurate)
    • Weighted average peeling (fast)
    • Weighted sum peeling (fast)
    Depth peeling is traditionally used to perform order independent transparency (OIT) with N geometry passes for N transparency layers. Dual depth peeling enables peeling N transparency layers in N/2+1 passes, by peeling from the front and the back simultaneously using a min-max depth buffer. This sample performs either normal or dual depth peeling and blends on the fly.
    Author:
    Louis Bavoil - original paper and C++ code, Martin Pernollet - port to Jzy3d
    • Field Detail

      • LOGGER

        protected org.apache.logging.log4j.Logger LOGGER
      • glu

        protected com.jogamp.opengl.glu.GLU glu
    • Constructor Detail

      • DepthPeelingRenderer3d

        public DepthPeelingRenderer3d​(View view,
                                      boolean traceGL,
                                      boolean debugGL)
      • DepthPeelingRenderer3d

        public DepthPeelingRenderer3d​(PeelingMethod algorithm,
                                      View view,
                                      boolean traceGL,
                                      boolean debugGL)
    • Method Detail

      • init

        public void init​(com.jogamp.opengl.GLAutoDrawable drawable)
        Description copied from class: Renderer3d
        Called when the GLAutoDrawable is rendered for the first time. When one calls Scene.init() function, this function is called and makes the OpenGL buffers initialization. Note: in this implementation, GL Exceptions are not triggered. To do so, make te following call at the beginning of the init() body: canvas.setGL( new DebugGL(canvas.getGL()) );
        Specified by:
        init in interface com.jogamp.opengl.GLEventListener
        Overrides:
        init in class Renderer3d
      • display

        public void display​(com.jogamp.opengl.GLAutoDrawable drawable)
        Description copied from class: Renderer3d
        Called when the GLAutoDrawable requires a rendering. All call to rendering methods should appear here.
        Specified by:
        display in interface com.jogamp.opengl.GLEventListener
        Overrides:
        display in class Renderer3d
      • getDepthPeelingContentRenderer

        public static IGLRenderer getDepthPeelingContentRenderer​(View view)
      • reshape

        public void reshape​(com.jogamp.opengl.GLAutoDrawable drawable,
                            int x,
                            int y,
                            int width,
                            int height)
        Rebuild all depth peeling buffers for the new screen size.
        Specified by:
        reshape in interface com.jogamp.opengl.GLEventListener
        Overrides:
        reshape in class Renderer3d
      • dispose

        public void dispose​(com.jogamp.opengl.GLAutoDrawable drawable)
        Specified by:
        dispose in interface com.jogamp.opengl.GLEventListener
        Overrides:
        dispose in class Renderer3d