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 =========================================================================*/
41 #ifndef vtkDepthPeelingPass_h
42 #define vtkDepthPeelingPass_h
43 
44 #include "vtkRenderingOpenGL2Module.h" // For export macro
45 #include "vtkRenderPass.h"
46 #include <vector> // STL Header
47 
48 class vtkTextureObject;
52 class vtkOpenGLHelper;
53 
54 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass : public vtkRenderPass
55 {
56 public:
57  static vtkDepthPeelingPass *New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
61  //BTX
63 
65  virtual void Render(const vtkRenderState *s);
66  //ETX
68 
72 
74 
77  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
78  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
80 
82 
89  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
90  vtkGetMacro(OcclusionRatio,double);
92 
94 
97  vtkSetMacro(MaximumNumberOfPeels,int);
98  vtkGetMacro(MaximumNumberOfPeels,int);
100 
102 
104  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
106 
115  static vtkInformationIntegerKey *OpaqueZTextureUnit();
116 
119  static vtkInformationIntegerKey *TranslucentZTextureUnit();
120 
122  static vtkInformationIntegerVectorKey *DestinationSize();
123 
124  protected:
127 
129  virtual ~vtkDepthPeelingPass();
130 
131  vtkRenderPass *TranslucentPass;
132  vtkTimeStamp CheckTime;
133  bool IsSupported;
134 
136 
137  int ViewportX;
138  int ViewportY;
139  int ViewportWidth;
140  int ViewportHeight;
142 
145  unsigned int DepthFormat;
146 
154  double OcclusionRatio;
155 
159  int MaximumNumberOfPeels;
160 
161  bool LastRenderingUsedDepthPeeling;
162 
163  // Is rendering at translucent geometry stage using depth peeling and
164  // rendering a layer other than the first one? (Boolean value)
165  // If so, the uniform variables UseTexture and Texture can be set.
166  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
167  int DepthPeelingHigherLayer;
168 
171 
177  std::vector<float> *DepthZData;
178 
179  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
180  void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
181 
182  private:
183  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
184  void operator=(const vtkDepthPeelingPass&); // Not implemented.
185 };
186 
187 #endif
vtkTextureObject * TranslucentZTexture
OpenGL rendering window.
Implement an Order Independent Transparency render pass.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkOpenGLHelper * IntermediateBlendProgram
std::vector< float > * DepthZData
void PrintSelf(ostream &os, vtkIndent indent)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
Context in which a vtkRenderPass will render.
vtkTextureObject * OpaqueZTexture
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
abstracts an OpenGL texture object.
virtual void Render(const vtkRenderState *s)=0
vtkTextureObject * OpaqueRGBATexture
vtkTextureObject * TranslucentRGBATexture
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkOpenGLHelper * FinalBlendProgram
static vtkObject * New()
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:54
vtkTextureObject * CurrentRGBATexture