Package org.jzy3d.plot3d.rendering.ddp
Class DepthPeelingRenderer3d
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.Renderer3d
-
- org.jzy3d.plot3d.rendering.ddp.DepthPeelingRenderer3d
-
- All Implemented Interfaces:
com.jogamp.opengl.GLEventListener
,EventListener
public class DepthPeelingRenderer3d extends Renderer3d
Execute depth peeling methods in a Jzy3dRenderer3d
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)
- Author:
- Louis Bavoil - original paper and C++ code, Martin Pernollet - port to Jzy3d
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
autoSwapBuffer
protected static boolean
AXE_IN_PEELING
protected static boolean
DEBUG
static boolean
DECOMPOSE_VIEW
protected IDepthPeelingAlgorithm
dualPeelingAlgorithm
protected org.apache.log4j.Logger
LOGGER
-
Fields inherited from class org.jzy3d.plot3d.rendering.view.Renderer3d
debugGL, doScreenshotAtNextDisplay, height, image, lastRenderingTimeMs, profileDisplayTimer, traceGL, view, width
-
-
Constructor Summary
Constructors Constructor Description DepthPeelingRenderer3d(PeelingMethod algorithm, DepthPeelingView view, boolean traceGL, boolean debugGL)
DepthPeelingRenderer3d(DepthPeelingView view, boolean traceGL, boolean debugGL)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(com.jogamp.opengl.GLAutoDrawable drawable)
Called when theGLAutoDrawable
requires a rendering.void
dispose(com.jogamp.opengl.GLAutoDrawable drawable)
static IDepthPeelingAlgorithm
getDepthPeelingAlgorithm(PeelingMethod method)
static IGLRenderer
getDepthPeelingContentRenderer(View view)
protected com.jogamp.opengl.GL2
getGL2(com.jogamp.opengl.GLAutoDrawable drawable)
void
init(com.jogamp.opengl.GLAutoDrawable canvas)
Called when theGLAutoDrawable
is rendered for the first time.void
postDisplay(com.jogamp.opengl.GL2 gl)
void
preDisplay(com.jogamp.opengl.GL2 gl)
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.-
Methods inherited from class org.jzy3d.plot3d.rendering.view.Renderer3d
getHeight, getLastRenderingTimeMs, getLastScreenshot, getWidth, nextDisplayUpdateScreenshot, updatePainterWithGL
-
-
-
-
Field Detail
-
LOGGER
protected org.apache.log4j.Logger LOGGER
-
dualPeelingAlgorithm
protected IDepthPeelingAlgorithm dualPeelingAlgorithm
-
autoSwapBuffer
protected boolean autoSwapBuffer
-
AXE_IN_PEELING
protected static boolean AXE_IN_PEELING
-
DEBUG
protected static boolean DEBUG
-
DECOMPOSE_VIEW
public static boolean DECOMPOSE_VIEW
-
-
Constructor Detail
-
DepthPeelingRenderer3d
public DepthPeelingRenderer3d(DepthPeelingView view, boolean traceGL, boolean debugGL)
-
DepthPeelingRenderer3d
public DepthPeelingRenderer3d(PeelingMethod algorithm, DepthPeelingView view, boolean traceGL, boolean debugGL)
-
-
Method Detail
-
init
public void init(com.jogamp.opengl.GLAutoDrawable canvas)
Description copied from class:Renderer3d
Called when theGLAutoDrawable
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 interfacecom.jogamp.opengl.GLEventListener
- Overrides:
init
in classRenderer3d
-
getGL2
protected com.jogamp.opengl.GL2 getGL2(com.jogamp.opengl.GLAutoDrawable drawable)
-
display
public void display(com.jogamp.opengl.GLAutoDrawable drawable)
Description copied from class:Renderer3d
Called when theGLAutoDrawable
requires a rendering. All call to rendering methods should appear here.- Specified by:
display
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
display
in classRenderer3d
-
postDisplay
public void postDisplay(com.jogamp.opengl.GL2 gl)
-
preDisplay
public void preDisplay(com.jogamp.opengl.GL2 gl)
-
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 interfacecom.jogamp.opengl.GLEventListener
- Overrides:
reshape
in classRenderer3d
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable drawable)
- Specified by:
dispose
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
dispose
in classRenderer3d
-
getDepthPeelingAlgorithm
public static IDepthPeelingAlgorithm getDepthPeelingAlgorithm(PeelingMethod method)
-
-