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 "vtkRenderPass.h"
45 
47 class vtkDepthPeelingPassLayerList; // Pimpl
48 class vtkShaderProgram2;
49 class vtkShader2;
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 
99 
101  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
103 
110  protected:
113 
115  virtual ~vtkDepthPeelingPass();
116 
119  void CheckSupport(vtkOpenGLRenderWindow *w);
120 
122  void CheckCompilation(unsigned int fragmentShader);
123 
125 
129  int RenderPeel(const vtkRenderState *s,
130  int layer);
132 
135  bool IsChecked;
137 
139 
145 
148  unsigned int DepthFormat;
149 
158 
163 
165 
167  vtkDepthPeelingPassLayerList *LayerList;
168 
169  unsigned int OpaqueLayerZ;
170  unsigned int TransparentLayerZ;
171 // unsigned int ProgramShader;
172 
173  // Is rendering at translucent geometry stage using depth peeling and
174  // rendering a layer other than the first one? (Boolean value)
175  // If so, the uniform variables UseTexture and Texture can be set.
176  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
178 
181 
182  int ShadowTexUnit; // texture unit allocated for the shadow texture
183  int OpaqueShadowTexUnit; // texture unit allocated for the opaque shadow tex.
184 
185  private:
186  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
187  void operator=(const vtkDepthPeelingPass&); // Not implemented.
188 };
189 
190 #endif