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 
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 
106  static vtkInformationIntegerKey *OpaqueZTextureUnit();
107 
110  static vtkInformationIntegerKey *TranslucentZTextureUnit();
111 
113  static vtkInformationIntegerVectorKey *DestinationSize();
114 
115  protected:
118 
120  virtual ~vtkDepthPeelingPass();
121 
122  vtkRenderPass *TranslucentPass;
123  vtkTimeStamp CheckTime;
124  bool IsSupported;
125 
127 
128  int ViewportX;
129  int ViewportY;
130  int ViewportWidth;
131  int ViewportHeight;
133 
136  unsigned int DepthFormat;
137 
145  double OcclusionRatio;
146 
150  int MaximumNumberOfPeels;
151 
152  // Is rendering at translucent geometry stage using depth peeling and
153  // rendering a layer other than the first one? (Boolean value)
154  // If so, the uniform variables UseTexture and Texture can be set.
155  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
156  int DepthPeelingHigherLayer;
157 
160 
166  std::vector<float> *DepthZData;
167 
168  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
169  void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
170 
171  private:
172  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
173  void operator=(const vtkDepthPeelingPass&); // Not implemented.
174 };
175 
176 #endif
vtkTextureObject * TranslucentZTexture
OpenGL rendering window.
Implement an Order Independent Transparency render pass.
#define VTKRENDERINGOPENGL2_EXPORT
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:57
vtkTextureObject * CurrentRGBATexture