VTK
vtkDepthPeelingPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDepthPeelingPass.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
47 #ifndef vtkDepthPeelingPass_h
48 #define vtkDepthPeelingPass_h
49 
50 #include "vtkRenderingOpenGL2Module.h" // For export macro
51 #include "vtkOpenGLRenderPass.h"
52 #include <vector> // STL Header
53 
54 class vtkTextureObject;
56 class vtkOpenGLHelper;
57 
58 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass
59  : public vtkOpenGLRenderPass
60 {
61 public:
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
70  virtual void Render(const vtkRenderState *s);
71 
78 
80 
86  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
87  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
89 
91 
100  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
101  vtkGetMacro(OcclusionRatio,double);
103 
105 
110  vtkSetMacro(MaximumNumberOfPeels,int);
111  vtkGetMacro(MaximumNumberOfPeels,int);
113 
122  // vtkOpenGLRenderPass virtuals:
123  virtual bool ReplaceShaderValues(std::string &vertexShader,
124  std::string &geometryShader,
125  std::string &fragmentShader,
126  vtkAbstractMapper *mapper,
127  vtkProp *prop);
128  virtual bool SetShaderParameters(vtkShaderProgram *program,
129  vtkAbstractMapper *mapper, vtkProp *prop);
130 
131  protected:
136 
141 
142  vtkRenderPass *TranslucentPass;
143  vtkTimeStamp CheckTime;
144  bool IsSupported;
145 
147 
150  int ViewportX;
151  int ViewportY;
152  int ViewportWidth;
153  int ViewportHeight;
155 
165  double OcclusionRatio;
166 
172  int MaximumNumberOfPeels;
173 
174  // Is rendering at translucent geometry stage using depth peeling and
175  // rendering a layer other than the first one? (Boolean value)
176  // If so, the uniform variables UseTexture and Texture can be set.
177  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
178  int DepthPeelingHigherLayer;
179 
182 
188  std::vector<float> *DepthZData;
189 
192 
193  private:
194  vtkDepthPeelingPass(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
195  void operator=(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
196 };
197 
198 #endif
vtkDepthPeelingPass::OpaqueZTexture
vtkTextureObject * OpaqueZTexture
Definition: vtkDepthPeelingPass.h:183
vtkDepthPeelingPass::BlendIntermediatePeels
void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool)
vtkDepthPeelingPass::New
static vtkDepthPeelingPass * New()
vtkDepthPeelingPass
Implement an Order Independent Transparency render pass.
Definition: vtkDepthPeelingPass.h:51
vtkDepthPeelingPass::IntermediateBlendProgram
vtkOpenGLHelper * IntermediateBlendProgram
Definition: vtkDepthPeelingPass.h:181
vtkDepthPeelingPass::DepthZData
std::vector< float > * DepthZData
Definition: vtkDepthPeelingPass.h:188
vtkDepthPeelingPass::~vtkDepthPeelingPass
virtual ~vtkDepthPeelingPass()
Destructor.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkDepthPeelingPass::vtkDepthPeelingPass
vtkDepthPeelingPass()
Default constructor.
vtkDepthPeelingPass::TranslucentZTexture
vtkTextureObject * TranslucentZTexture
Definition: vtkDepthPeelingPass.h:186
vtkDepthPeelingPass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkDepthPeelingPass::BlendFinalPeel
void BlendFinalPeel(vtkOpenGLRenderWindow *renWin)
vtkDepthPeelingPass::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkDepthPeelingPass::SetShaderParameters
virtual bool SetShaderParameters(vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkProp *prop)
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:45
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkDepthPeelingPass::TranslucentRGBATexture
vtkTextureObject * TranslucentRGBATexture
Definition: vtkDepthPeelingPass.h:185
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:41
vtkDepthPeelingPass::FinalBlendProgram
vtkOpenGLHelper * FinalBlendProgram
Definition: vtkDepthPeelingPass.h:180
vtkDepthPeelingPass::CurrentRGBATexture
vtkTextureObject * CurrentRGBATexture
Definition: vtkDepthPeelingPass.h:187
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkOpenGLRenderPass
Abstract render pass with shader modifications.
Definition: vtkOpenGLRenderPass.h:38
vtkDepthPeelingPass::Render
virtual void Render(const vtkRenderState *s)
Perform rendering according to a render state s.
vtkOpenGLRenderPass.h
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:39
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:41
vtkDepthPeelingPass::OpaqueRGBATexture
vtkTextureObject * OpaqueRGBATexture
Definition: vtkDepthPeelingPass.h:184
vtkDepthPeelingPass::SetTranslucentPass
virtual void SetTranslucentPass(vtkRenderPass *translucentPass)
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:56
vtkDepthPeelingPass::ReplaceShaderValues
virtual bool ReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop)
Is rendering at translucent geometry stage using depth peeling and rendering a layer other than the f...
vtkRenderPass
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:59