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 =========================================================================*/
38 #ifndef vtkDepthPeelingPass_h
39 #define vtkDepthPeelingPass_h
40 
41 #include "vtkRenderingOpenGL2Module.h" // For export macro
42 #include "vtkRenderPass.h"
43 #include <vector> // STL Header
44 
45 class vtkTextureObject;
49 class vtkOpenGLHelper;
50 
51 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass : public vtkRenderPass
52 {
53 public:
54  static vtkDepthPeelingPass *New();
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
58  //BTX
60 
62  virtual void Render(const vtkRenderState *s);
63  //ETX
65 
69 
71 
74  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
75  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
77 
79 
86  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
87  vtkGetMacro(OcclusionRatio,double);
89 
91 
94  vtkSetMacro(MaximumNumberOfPeels,int);
95  vtkGetMacro(MaximumNumberOfPeels,int);
97 
99 
101  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
103 
112  static vtkInformationIntegerKey *OpaqueZTextureUnit();
113 
116  static vtkInformationIntegerKey *TranslucentZTextureUnit();
117 
119  static vtkInformationIntegerVectorKey *DestinationSize();
120 
121  protected:
124 
126  virtual ~vtkDepthPeelingPass();
127 
128  vtkRenderPass *TranslucentPass;
129  vtkTimeStamp CheckTime;
130  bool IsSupported;
131 
133 
134  int ViewportX;
135  int ViewportY;
136  int ViewportWidth;
137  int ViewportHeight;
139 
142  unsigned int DepthFormat;
143 
151  double OcclusionRatio;
152 
156  int MaximumNumberOfPeels;
157 
158  bool LastRenderingUsedDepthPeeling;
159 
160  // Is rendering at translucent geometry stage using depth peeling and
161  // rendering a layer other than the first one? (Boolean value)
162  // If so, the uniform variables UseTexture and Texture can be set.
163  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
164  int DepthPeelingHigherLayer;
165 
168 
174  std::vector<float> *DepthZData;
175 
176  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
177  void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
178 
179  private:
180  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
181  void operator=(const vtkDepthPeelingPass&); // Not implemented.
182 };
183 
184 #endif
vtkTextureObject * TranslucentZTexture
OpenGL rendering window.
Implement an Order Independent Transparency render pass.
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkOpenGLHelper * IntermediateBlendProgram
std::vector< float > * DepthZData
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
void PrintSelf(ostream &os, vtkIndent indent)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:33
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.
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
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:57
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:79
vtkTextureObject * CurrentRGBATexture