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 =========================================================================*/
44 #ifndef vtkDepthPeelingPass_h
45 #define vtkDepthPeelingPass_h
46 
47 #include "vtkRenderingOpenGL2Module.h" // For export macro
48 #include "vtkOpenGLRenderPass.h"
49 #include <vector> // STL Header
50 
51 class vtkTextureObject;
53 class vtkOpenGLHelper;
54 
55 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass
56  : public vtkOpenGLRenderPass
57 {
58 public:
59  static vtkDepthPeelingPass *New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
67  virtual void Render(const vtkRenderState *s);
68 
75 
77 
83  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
84  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
86 
88 
97  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
98  vtkGetMacro(OcclusionRatio,double);
100 
102 
107  vtkSetMacro(MaximumNumberOfPeels,int);
108  vtkGetMacro(MaximumNumberOfPeels,int);
110 
119  // vtkOpenGLRenderPass virtuals:
120  virtual bool ReplaceShaderValues(std::string &vertexShader,
121  std::string &geometryShader,
122  std::string &fragmentShader,
123  vtkAbstractMapper *mapper,
124  vtkProp *prop);
125  virtual bool SetShaderParameters(vtkShaderProgram *program,
126  vtkAbstractMapper *mapper, vtkProp *prop);
127 
128  protected:
133 
137  virtual ~vtkDepthPeelingPass();
138 
139  vtkRenderPass *TranslucentPass;
140  vtkTimeStamp CheckTime;
141  bool IsSupported;
142 
144 
147  int ViewportX;
148  int ViewportY;
149  int ViewportWidth;
150  int ViewportHeight;
152 
162  double OcclusionRatio;
163 
169  int MaximumNumberOfPeels;
170 
171  // Is rendering at translucent geometry stage using depth peeling and
172  // rendering a layer other than the first one? (Boolean value)
173  // If so, the uniform variables UseTexture and Texture can be set.
174  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
175  int DepthPeelingHigherLayer;
176 
179 
185  std::vector<float> *DepthZData;
186 
187  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
188  void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
189 
190  private:
191  vtkDepthPeelingPass(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
192  void operator=(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
193 };
194 
195 #endif
vtkDepthPeelingPass::OpaqueZTexture
vtkTextureObject * OpaqueZTexture
Definition: vtkDepthPeelingPass.h:180
vtkDepthPeelingPass
Implement an Order Independent Transparency render pass.
Definition: vtkDepthPeelingPass.h:53
vtkDepthPeelingPass::IntermediateBlendProgram
vtkOpenGLHelper * IntermediateBlendProgram
Definition: vtkDepthPeelingPass.h:178
vtkRenderPass::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
vtkDepthPeelingPass::DepthZData
std::vector< float > * DepthZData
Definition: vtkDepthPeelingPass.h:185
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkRenderPass::Render
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
vtkDepthPeelingPass::TranslucentZTexture
vtkTextureObject * TranslucentZTexture
Definition: vtkDepthPeelingPass.h:183
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkOpenGLRenderPass::SetShaderParameters
virtual bool SetShaderParameters(vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkProp *prop)
Update the uniforms of the shader program.
vtkOpenGLRenderPass::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:44
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:30
vtkDepthPeelingPass::TranslucentRGBATexture
vtkTextureObject * TranslucentRGBATexture
Definition: vtkDepthPeelingPass.h:182
vtkOpenGLRenderPass::ReplaceShaderValues
virtual bool ReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop)
Use vtkShaderProgram::Substitute to replace //VTK::XXX:YYY declarations in the shader sources.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:43
vtkDepthPeelingPass::FinalBlendProgram
vtkOpenGLHelper * FinalBlendProgram
Definition: vtkDepthPeelingPass.h:177
vtkDepthPeelingPass::CurrentRGBATexture
vtkTextureObject * CurrentRGBATexture
Definition: vtkDepthPeelingPass.h:184
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkOpenGLRenderPass
Abstract render pass with shader modifications.
Definition: vtkOpenGLRenderPass.h:37
vtkOpenGLRenderPass.h
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:41
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:40
vtkDepthPeelingPass::OpaqueRGBATexture
vtkTextureObject * OpaqueRGBATexture
Definition: vtkDepthPeelingPass.h:181
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:55
vtkRenderPass
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:58