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 =========================================================================*/
42 #ifndef vtkDepthPeelingPass_h
43 #define vtkDepthPeelingPass_h
44 
45 #include "vtkRenderingOpenGLModule.h" // For export macro
46 #include "vtkRenderPass.h"
47 
49 class vtkDepthPeelingPassLayerList; // Pimpl
50 class vtkShaderProgram2;
51 class vtkShader2;
52 
53 class VTKRENDERINGOPENGL_EXPORT vtkDepthPeelingPass : public vtkRenderPass
54 {
55 public:
56  static vtkDepthPeelingPass *New();
58  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
59 
64  void Render(const vtkRenderState *s) VTK_OVERRIDE;
65 
71  void ReleaseGraphicsResources(vtkWindow *w) VTK_OVERRIDE;
72 
74 
80  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
81  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
83 
85 
94  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
95  vtkGetMacro(OcclusionRatio,double);
97 
99 
104  vtkSetMacro(MaximumNumberOfPeels,int);
105  vtkGetMacro(MaximumNumberOfPeels,int);
107 
109 
113  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
115 
124  protected:
129 
133  ~vtkDepthPeelingPass() VTK_OVERRIDE;
134 
139  void CheckSupport(vtkOpenGLRenderWindow *w);
140 
144  void CheckCompilation(unsigned int fragmentShader);
145 
153  int RenderPeel(const vtkRenderState *s,
154  int layer);
155 
156  vtkRenderPass *TranslucentPass;
157  vtkTimeStamp CheckTime;
158  bool IsChecked;
159  bool IsSupported;
160 
162 
165  int ViewportX;
166  int ViewportY;
167  int ViewportWidth;
168  int ViewportHeight;
170 
175  unsigned int DepthFormat;
176 
186  double OcclusionRatio;
187 
193  int MaximumNumberOfPeels;
194 
195  bool LastRenderingUsedDepthPeeling;
196 
200  vtkDepthPeelingPassLayerList *LayerList;
201 
202  unsigned int OpaqueLayerZ;
203  unsigned int TransparentLayerZ;
204 // unsigned int ProgramShader;
205 
206  // Is rendering at translucent geometry stage using depth peeling and
207  // rendering a layer other than the first one? (Boolean value)
208  // If so, the uniform variables UseTexture and Texture can be set.
209  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
210  int DepthPeelingHigherLayer;
211 
213  vtkShader2 *Shader;
214 
215  int ShadowTexUnit; // texture unit allocated for the shadow texture
216  int OpaqueShadowTexUnit; // texture unit allocated for the opaque shadow tex.
217 
218  private:
219  vtkDepthPeelingPass(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
220  void operator=(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
221 };
222 
223 #endif
OpenGL rendering window.
GLSL Shader.
Definition: vtkShader2.h:62
Implement an Order Independent Transparency render pass.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
Context in which a vtkRenderPass will render.
GLSL Program.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
virtual void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:58
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.