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 namespace vtkgl
53 {
54  class CellBO;
55 }
56 
57 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass : public vtkRenderPass
58 {
59 public:
60  static vtkDepthPeelingPass *New();
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
64  //BTX
66 
68  virtual void Render(const vtkRenderState *s);
69  //ETX
71 
74  void ReleaseGraphicsResources(vtkWindow *w);
75 
77 
80  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
81  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
83 
85 
92  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
93  vtkGetMacro(OcclusionRatio,double);
95 
97 
100  vtkSetMacro(MaximumNumberOfPeels,int);
101  vtkGetMacro(MaximumNumberOfPeels,int);
103 
105 
107  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
109 
118  static vtkInformationIntegerKey *OpaqueZTextureUnit();
119 
122  static vtkInformationIntegerKey *TranslucentZTextureUnit();
123 
125  static vtkInformationIntegerVectorKey *DestinationSize();
126 
127  protected:
130 
132  virtual ~vtkDepthPeelingPass();
133 
134  vtkRenderPass *TranslucentPass;
135  vtkTimeStamp CheckTime;
136  bool IsSupported;
137 
139 
140  int ViewportX;
141  int ViewportY;
142  int ViewportWidth;
143  int ViewportHeight;
145 
148  unsigned int DepthFormat;
149 
157  double OcclusionRatio;
158 
162  int MaximumNumberOfPeels;
163 
164  bool LastRenderingUsedDepthPeeling;
165 
166  // Is rendering at translucent geometry stage using depth peeling and
167  // rendering a layer other than the first one? (Boolean value)
168  // If so, the uniform variables UseTexture and Texture can be set.
169  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
170  int DepthPeelingHigherLayer;
171 
174 
180  std::vector<float> *DepthZData;
181 
182  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin);
183  void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
184 
185  private:
186  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
187  void operator=(const vtkDepthPeelingPass&); // Not implemented.
188 };
189 
190 #endif
vtkTextureObject * TranslucentZTexture
OpenGL rendering window.
Implement an Order Independent Transparency render pass.
vtkgl::CellBO * FinalBlendProgram
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
record modification and/or execution time
Definition: vtkTimeStamp.h:34
std::vector< float > * DepthZData
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
window superclass for vtkRenderWindow
Definition: vtkWindow.h:33
Context in which a vtkRenderPass will render.
vtkTextureObject * OpaqueZTexture
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
Definition: vtkgl.h:11267
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
abstracts an OpenGL texture object.
vtkTextureObject * OpaqueRGBATexture
vtkTextureObject * TranslucentRGBATexture
GLdouble s
Definition: vtkgl.h:11594
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:54
vtkgl::CellBO * IntermediateBlendProgram
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69
vtkTextureObject * CurrentRGBATexture