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 "vtkRenderingOpenGLModule.h" // For export macro
42 #include "vtkRenderPass.h"
43 
45 class vtkDepthPeelingPassLayerList; // Pimpl
46 class vtkShaderProgram2;
47 class vtkShader2;
48 
50 {
51 public:
52  static vtkDepthPeelingPass *New();
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
56  //BTX
58 
60  virtual void Render(const vtkRenderState *s);
61  //ETX
63 
67 
69 
72  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
73  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
75 
77 
84  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
85  vtkGetMacro(OcclusionRatio,double);
87 
89 
92  vtkSetMacro(MaximumNumberOfPeels,int);
93  vtkGetMacro(MaximumNumberOfPeels,int);
95 
97 
99  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
101 
108  protected:
111 
113  virtual ~vtkDepthPeelingPass();
114 
117  void CheckSupport(vtkOpenGLRenderWindow *w);
118 
120  void CheckCompilation(unsigned int fragmentShader);
121 
123 
127  int RenderPeel(const vtkRenderState *s,
128  int layer);
130 
133  bool IsChecked;
135 
137 
143 
146  unsigned int DepthFormat;
147 
156 
161 
163 
165  vtkDepthPeelingPassLayerList *LayerList;
166 
167  unsigned int OpaqueLayerZ;
168  unsigned int TransparentLayerZ;
169 // unsigned int ProgramShader;
170 
171  // Is rendering at translucent geometry stage using depth peeling and
172  // rendering a layer other than the first one? (Boolean value)
173  // If so, the uniform variables UseTexture and Texture can be set.
174  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
176 
179 
180  int ShadowTexUnit; // texture unit allocated for the shadow texture
181  int OpaqueShadowTexUnit; // texture unit allocated for the opaque shadow tex.
182 
183  private:
184  vtkDepthPeelingPass(const vtkDepthPeelingPass&); // Not implemented.
185  void operator=(const vtkDepthPeelingPass&); // Not implemented.
186 };
187 
188 #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
#define VTKRENDERINGOPENGL_EXPORT
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:54