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 =========================================================================*/
39 #ifndef vtkDepthPeelingPass_h
40 #define vtkDepthPeelingPass_h
41 
42 #include "vtkRenderingOpenGLModule.h" // For export macro
43 #include "vtkRenderPass.h"
44 
46 class vtkDepthPeelingPassLayerList; // Pimpl
47 class vtkShaderProgram2;
48 class vtkShader2;
49 
50 class VTKRENDERINGOPENGL_EXPORT vtkDepthPeelingPass : public vtkRenderPass
51 {
52 public:
53  static vtkDepthPeelingPass *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
61  virtual void Render(const vtkRenderState *s);
62 
69 
71 
77  vtkGetObjectMacro(TranslucentPass,vtkRenderPass);
78  virtual void SetTranslucentPass(vtkRenderPass *translucentPass);
80 
82 
91  vtkSetClampMacro(OcclusionRatio,double,0.0,0.5);
92  vtkGetMacro(OcclusionRatio,double);
94 
96 
101  vtkSetMacro(MaximumNumberOfPeels,int);
102  vtkGetMacro(MaximumNumberOfPeels,int);
104 
106 
110  vtkGetMacro(LastRenderingUsedDepthPeeling,bool);
112 
121  protected:
126 
130  virtual ~vtkDepthPeelingPass();
131 
136  void CheckSupport(vtkOpenGLRenderWindow *w);
137 
141  void CheckCompilation(unsigned int fragmentShader);
142 
150  int RenderPeel(const vtkRenderState *s,
151  int layer);
152 
155  bool IsChecked;
157 
159 
167 
172  unsigned int DepthFormat;
173 
184 
191 
193 
197  vtkDepthPeelingPassLayerList *LayerList;
198 
199  unsigned int OpaqueLayerZ;
200  unsigned int TransparentLayerZ;
201 // unsigned int ProgramShader;
202 
203  // Is rendering at translucent geometry stage using depth peeling and
204  // rendering a layer other than the first one? (Boolean value)
205  // If so, the uniform variables UseTexture and Texture can be set.
206  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
208 
211 
212  int ShadowTexUnit; // texture unit allocated for the shadow texture
213  int OpaqueShadowTexUnit; // texture unit allocated for the opaque shadow tex.
214 
215  private:
216  vtkDepthPeelingPass(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
217  void operator=(const vtkDepthPeelingPass&) VTK_DELETE_FUNCTION;
218 };
219 
220 #endif
vtkDepthPeelingPass::Prog
vtkShaderProgram2 * Prog
Definition: vtkDepthPeelingPass.h:209
vtkDepthPeelingPass::TranslucentPass
vtkRenderPass * TranslucentPass
Definition: vtkDepthPeelingPass.h:153
vtkDepthPeelingPass
Implement an Order Independent Transparency render pass.
Definition: vtkDepthPeelingPass.h:50
vtkRenderPass::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
vtkDepthPeelingPass::Shader
vtkShader2 * Shader
Definition: vtkDepthPeelingPass.h:210
vtkDepthPeelingPass::ViewportHeight
int ViewportHeight
Definition: vtkDepthPeelingPass.h:165
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkDepthPeelingPass::DepthFormat
unsigned int DepthFormat
Actual depth format: vtkgl::DEPTH_COMPONENT16_ARB or vtkgl::DEPTH_COMPONENT24_ARB.
Definition: vtkDepthPeelingPass.h:172
vtkRenderPass::Render
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
vtkRenderPass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkRenderPass.h
vtkDepthPeelingPass::TransparentLayerZ
unsigned int TransparentLayerZ
Definition: vtkDepthPeelingPass.h:200
vtkDepthPeelingPass::ShadowTexUnit
int ShadowTexUnit
Definition: vtkDepthPeelingPass.h:212
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkDepthPeelingPass::ViewportY
int ViewportY
Definition: vtkDepthPeelingPass.h:163
vtkDepthPeelingPass::IsSupported
bool IsSupported
Definition: vtkDepthPeelingPass.h:156
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDepthPeelingPass::DepthPeelingHigherLayer
int DepthPeelingHigherLayer
Definition: vtkDepthPeelingPass.h:207
vtkDepthPeelingPass::OpaqueLayerZ
unsigned int OpaqueLayerZ
Definition: vtkDepthPeelingPass.h:199
vtkDepthPeelingPass::LayerList
vtkDepthPeelingPassLayerList * LayerList
Used by the depth peeling technique to store the transparency layers.
Definition: vtkDepthPeelingPass.h:197
vtkDepthPeelingPass::ViewportX
int ViewportX
Cache viewport values for depth peeling.
Definition: vtkDepthPeelingPass.h:162
vtkDepthPeelingPass::LastRenderingUsedDepthPeeling
bool LastRenderingUsedDepthPeeling
Definition: vtkDepthPeelingPass.h:192
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkShaderProgram2
GLSL Program.
Definition: vtkShaderProgram2.h:68
vtkDepthPeelingPass::OpaqueShadowTexUnit
int OpaqueShadowTexUnit
Definition: vtkDepthPeelingPass.h:213
vtkDepthPeelingPass::IsChecked
bool IsChecked
Definition: vtkDepthPeelingPass.h:155
vtkShader2
GLSL Shader.
Definition: vtkShader2.h:62
vtkDepthPeelingPass::ViewportWidth
int ViewportWidth
Definition: vtkDepthPeelingPass.h:164
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:38
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:40
vtkDepthPeelingPass::MaximumNumberOfPeels
int MaximumNumberOfPeels
In case of depth peeling, define the maximum number of peeling layers.
Definition: vtkDepthPeelingPass.h:190
vtkDepthPeelingPass::CheckTime
vtkTimeStamp CheckTime
Definition: vtkDepthPeelingPass.h:154
vtkDepthPeelingPass::OcclusionRatio
double OcclusionRatio
In case of use of depth peeling technique for rendering translucent material, define the threshold un...
Definition: vtkDepthPeelingPass.h:183
vtkRenderPass
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:58