VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkDepthPeelingPass Class Reference

Implement an Order Independent Transparency render pass. More...

#include <vtkDepthPeelingPass.h>

Inheritance diagram for vtkDepthPeelingPass:
Inheritance graph
[legend]
Collaboration diagram for vtkDepthPeelingPass:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkRenderPass Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkDepthPeelingPassNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void ReleaseGraphicsResources (vtkWindow *w)
virtual void Render (const vtkRenderState *s)
virtual vtkRenderPassGetTranslucentPass ()
virtual void SetTranslucentPass (vtkRenderPass *translucentPass)
virtual void SetOcclusionRatio (double)
virtual double GetOcclusionRatio ()
virtual void SetMaximumNumberOfPeels (int)
virtual int GetMaximumNumberOfPeels ()
virtual bool GetLastRenderingUsedDepthPeeling ()

Static Public Member Functions

static vtkDepthPeelingPassNew ()
static int IsTypeOf (const char *type)
static vtkDepthPeelingPassSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkDepthPeelingPass ()
virtual ~vtkDepthPeelingPass ()
void CheckSupport (vtkOpenGLRenderWindow *w)
void CheckCompilation (unsigned int fragmentShader)
int RenderPeel (const vtkRenderState *s, int layer)

Protected Attributes

vtkRenderPassTranslucentPass
vtkTimeStamp CheckTime
bool IsChecked
bool IsSupported
unsigned int DepthFormat
double OcclusionRatio
int MaximumNumberOfPeels
bool LastRenderingUsedDepthPeeling
vtkDepthPeelingPassLayerList * LayerList
unsigned int OpaqueLayerZ
unsigned int TransparentLayerZ
int DepthPeelingHigherLayer
vtkShaderProgram2Prog
vtkShader2Shader
int ShadowTexUnit
int OpaqueShadowTexUnit
int ViewportX
int ViewportY
int ViewportWidth
int ViewportHeight

Detailed Description

Implement an Order Independent Transparency render pass.

Render the translucent polygonal geometry of a scene without sorting polygons in the view direction.

This pass expects an initialized depth buffer and color buffer. Initialized buffers means they have been cleared with farest z-value and background color/gradient/transparent color. An opaque pass may have been performed right after the initialization.

The depth peeling algorithm works by rendering the translucent polygonal geometry multiple times (once for each peel). The actually rendering of the translucent polygonal geometry is performed by its delegate TranslucentPass. This delegate is therefore used multiple times.

Its delegate is usually set to a vtkTranslucentPass.

See also:
vtkRenderPass, vtkTranslucentPass
Tests:
vtkDepthPeelingPass (Tests)

Definition at line 52 of file vtkDepthPeelingPass.h.


Member Typedef Documentation

Reimplemented from vtkRenderPass.

Definition at line 56 of file vtkDepthPeelingPass.h.


Constructor & Destructor Documentation

Is rendering at translucent geometry stage using depth peeling and rendering a layer other than the first one? (Boolean value) If so, the uniform variables UseTexture and Texture can be set. (Used by vtkOpenGLProperty or vtkOpenGLTexture) int GetDepthPeelingHigherLayer();

Default constructor. TranslucentPass is set to NULL.

virtual vtkDepthPeelingPass::~vtkDepthPeelingPass ( ) [protected, virtual]

Destructor.


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

static int vtkDepthPeelingPass::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkRenderPass.

virtual int vtkDepthPeelingPass::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkRenderPass.

Reimplemented from vtkRenderPass.

virtual vtkObjectBase* vtkDepthPeelingPass::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkRenderPass.

Reimplemented from vtkRenderPass.

void vtkDepthPeelingPass::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkRenderPass.

virtual void vtkDepthPeelingPass::Render ( const vtkRenderState s) [virtual]

Perform rendering according to a render state s.

Precondition:
s_exists: s!=0

Implements vtkRenderPass.

Release graphics resources and ask components to release their own resources.

Precondition:
w_exists: w!=0

Reimplemented from vtkRenderPass.

Delegate for rendering the translucent polygonal geometry. If it is NULL, nothing will be rendered and a warning will be emitted. It is usually set to a vtkTranslucentPass. Initial value is a NULL pointer.

virtual void vtkDepthPeelingPass::SetTranslucentPass ( vtkRenderPass translucentPass) [virtual]

Delegate for rendering the translucent polygonal geometry. If it is NULL, nothing will be rendered and a warning will be emitted. It is usually set to a vtkTranslucentPass. Initial value is a NULL pointer.

virtual void vtkDepthPeelingPass::SetOcclusionRatio ( double  ) [virtual]

In case of use of depth peeling technique for rendering translucent material, define the threshold under which the algorithm stops to iterate over peel layers. This is the ratio of the number of pixels that have been touched by the last layer over the total number of pixels of the viewport area. Initial value is 0.0, meaning rendering have to be exact. Greater values may speed-up the rendering with small impact on the quality.

In case of use of depth peeling technique for rendering translucent material, define the threshold under which the algorithm stops to iterate over peel layers. This is the ratio of the number of pixels that have been touched by the last layer over the total number of pixels of the viewport area. Initial value is 0.0, meaning rendering have to be exact. Greater values may speed-up the rendering with small impact on the quality.

virtual void vtkDepthPeelingPass::SetMaximumNumberOfPeels ( int  ) [virtual]

In case of depth peeling, define the maximum number of peeling layers. Initial value is 4. A special value of 0 means no maximum limit. It has to be a positive value.

In case of depth peeling, define the maximum number of peeling layers. Initial value is 4. A special value of 0 means no maximum limit. It has to be a positive value.

Tells if the last time this pass was executed, the depth peeling algorithm was actually used. Initial value is false.

Check if depth peeling is supported by the current OpenGL context.

Precondition:
w_exists: w!=0
void vtkDepthPeelingPass::CheckCompilation ( unsigned int  fragmentShader) [protected]

Check the compilation status of some fragment shader source.

int vtkDepthPeelingPass::RenderPeel ( const vtkRenderState s,
int  layer 
) [protected]

Render a peel layer. If there is no more GPU RAM to save the texture, return false otherwise returns true. Also if layer==0 and no prop have been rendered (there is no translucent geometry), it returns false.

Precondition:
s_exists: s!=0
positive_layer: layer>=0

Member Data Documentation

Definition at line 134 of file vtkDepthPeelingPass.h.

Definition at line 135 of file vtkDepthPeelingPass.h.

Definition at line 136 of file vtkDepthPeelingPass.h.

Definition at line 137 of file vtkDepthPeelingPass.h.

Cache viewport values for depth peeling.

Definition at line 141 of file vtkDepthPeelingPass.h.

Cache viewport values for depth peeling.

Definition at line 142 of file vtkDepthPeelingPass.h.

Cache viewport values for depth peeling.

Definition at line 143 of file vtkDepthPeelingPass.h.

Cache viewport values for depth peeling.

Definition at line 144 of file vtkDepthPeelingPass.h.

unsigned int vtkDepthPeelingPass::DepthFormat [protected]

Actual depth format: vtkgl::DEPTH_COMPONENT16_ARB or vtkgl::DEPTH_COMPONENT24_ARB

Definition at line 149 of file vtkDepthPeelingPass.h.

In case of use of depth peeling technique for rendering translucent material, define the threshold under which the algorithm stops to iterate over peel layers. This is the ratio of the number of pixels that have been touched by the last layer over the total number of pixels of the viewport area. Initial value is 0.0, meaning rendering have to be exact. Greater values may speed-up the rendering with small impact on the quality.

Definition at line 158 of file vtkDepthPeelingPass.h.

In case of depth peeling, define the maximum number of peeling layers. Initial value is 4. A special value of 0 means no maximum limit. It has to be a positive value.

Definition at line 163 of file vtkDepthPeelingPass.h.

Definition at line 165 of file vtkDepthPeelingPass.h.

vtkDepthPeelingPassLayerList* vtkDepthPeelingPass::LayerList [protected]

Used by the depth peeling technique to store the transparency layers.

Definition at line 168 of file vtkDepthPeelingPass.h.

unsigned int vtkDepthPeelingPass::OpaqueLayerZ [protected]

Definition at line 170 of file vtkDepthPeelingPass.h.

Definition at line 171 of file vtkDepthPeelingPass.h.

Definition at line 178 of file vtkDepthPeelingPass.h.

Definition at line 180 of file vtkDepthPeelingPass.h.

Definition at line 181 of file vtkDepthPeelingPass.h.

Definition at line 183 of file vtkDepthPeelingPass.h.

Definition at line 184 of file vtkDepthPeelingPass.h.


The documentation for this class was generated from the following file: