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 "vtkRenderingOpenGLModule.h" // For export macro
45 #include "vtkRenderPass.h"
46 
48 class vtkDepthPeelingPassLayerList; // Pimpl
49 class vtkShaderProgram2;
50 class vtkShader2;
51 
52 class VTKRENDERINGOPENGL_EXPORT vtkDepthPeelingPass : public vtkRenderPass
53 {
54 public:
55  static vtkDepthPeelingPass *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
59  //BTX
61 
63  virtual void Render(const vtkRenderState *s);
64  //ETX
66 
70 
72 
75  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
76  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
78 
80 
87  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
88  vtkGetMacro(OcclusionRatio,double);
90 
92 
95  vtkSetMacro(MaximumNumberOfPeels,int);
96  vtkGetMacro(MaximumNumberOfPeels,int);
98 
100 
102  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
104 
111  protected:
114 
116  virtual ~vtkDepthPeelingPass();
117 
120  void CheckSupport(vtkOpenGLRenderWindow *w);
121 
123  void CheckCompilation(unsigned int fragmentShader);
124 
126 
130  int RenderPeel(const vtkRenderState *s,
131  int layer);
133 
136  bool IsChecked;
138 
140 
146 
149  unsigned int DepthFormat;
150 
159 
164 
166 
168  vtkDepthPeelingPassLayerList *LayerList;
169 
170  unsigned int OpaqueLayerZ;
171  unsigned int TransparentLayerZ;
172 // unsigned int ProgramShader;
173 
174  // Is rendering at translucent geometry stage using depth peeling and
175  // rendering a layer other than the first one? (Boolean value)
176  // If so, the uniform variables UseTexture and Texture can be set.
177  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
179 
182 
183  int ShadowTexUnit; // texture unit allocated for the shadow texture
184  int OpaqueShadowTexUnit; // texture unit allocated for the opaque shadow tex.
185 
186  private:
187  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
188  void operator=(const vtkDepthPeelingPass&); // Not implemented.
189 };
190 
191 #endif
OpenGL rendering window.
GLSL Shader.
Definition: vtkShader2.h:61
vtkRenderPass * TranslucentPass
Implement an Order Independent Transparency render pass.
vtkShaderProgram2 * Prog
record modification and/or execution time
Definition: vtkTimeStamp.h:34
unsigned int TransparentLayerZ
void PrintSelf(ostream &os, vtkIndent indent)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
Context in which a vtkRenderPass will render.
GLSL Program.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void Render(const vtkRenderState *s)=0
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkDepthPeelingPassLayerList * LayerList
static vtkObject * New()
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:57