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:
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
64  virtual void Render(const vtkRenderState *s);
65 
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 
134 
140 
144  void CheckCompilation(unsigned int fragmentShader);
145 
154  int layer);
155 
158  bool IsChecked;
160 
162 
170 
175  unsigned int DepthFormat;
176 
187 
194 
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)
211 
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
vtkDepthPeelingPass::Prog
vtkShaderProgram2 * Prog
Definition: vtkDepthPeelingPass.h:212
vtkDepthPeelingPass::CheckCompilation
void CheckCompilation(unsigned int fragmentShader)
Check the compilation status of some fragment shader source.
vtkDepthPeelingPass::TranslucentPass
vtkRenderPass * TranslucentPass
Definition: vtkDepthPeelingPass.h:156
vtkDepthPeelingPass::New
static vtkDepthPeelingPass * New()
vtkDepthPeelingPass
Implement an Order Independent Transparency render pass.
Definition: vtkDepthPeelingPass.h:54
vtkDepthPeelingPass::Shader
vtkShader2 * Shader
Definition: vtkDepthPeelingPass.h:213
vtkDepthPeelingPass::~vtkDepthPeelingPass
virtual ~vtkDepthPeelingPass()
Destructor.
vtkDepthPeelingPass::ViewportHeight
int ViewportHeight
Definition: vtkDepthPeelingPass.h:168
vtkDepthPeelingPass::CheckSupport
void CheckSupport(vtkOpenGLRenderWindow *w)
Check if depth peeling is supported by the current OpenGL context.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkDepthPeelingPass::DepthFormat
unsigned int DepthFormat
Actual depth format: vtkgl::DEPTH_COMPONENT16_ARB or vtkgl::DEPTH_COMPONENT24_ARB.
Definition: vtkDepthPeelingPass.h:175
vtkDepthPeelingPass::vtkDepthPeelingPass
vtkDepthPeelingPass()
Is rendering at translucent geometry stage using depth peeling and rendering a layer other than the f...
vtkRenderPass.h
vtkDepthPeelingPass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkDepthPeelingPass::TransparentLayerZ
unsigned int TransparentLayerZ
Definition: vtkDepthPeelingPass.h:203
vtkDepthPeelingPass::RenderPeel
int RenderPeel(const vtkRenderState *s, int layer)
Render a peel layer.
vtkDepthPeelingPass::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
vtkDepthPeelingPass::ShadowTexUnit
int ShadowTexUnit
Definition: vtkDepthPeelingPass.h:215
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkDepthPeelingPass::ViewportY
int ViewportY
Definition: vtkDepthPeelingPass.h:166
vtkDepthPeelingPass::IsSupported
bool IsSupported
Definition: vtkDepthPeelingPass.h:159
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkDepthPeelingPass::DepthPeelingHigherLayer
int DepthPeelingHigherLayer
Definition: vtkDepthPeelingPass.h:210
vtkDepthPeelingPass::OpaqueLayerZ
unsigned int OpaqueLayerZ
Definition: vtkDepthPeelingPass.h:202
vtkDepthPeelingPass::LayerList
vtkDepthPeelingPassLayerList * LayerList
Used by the depth peeling technique to store the transparency layers.
Definition: vtkDepthPeelingPass.h:200
vtkDepthPeelingPass::ViewportX
int ViewportX
Cache viewport values for depth peeling.
Definition: vtkDepthPeelingPass.h:165
vtkDepthPeelingPass::LastRenderingUsedDepthPeeling
bool LastRenderingUsedDepthPeeling
Definition: vtkDepthPeelingPass.h:195
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkShaderProgram2
GLSL Program.
Definition: vtkShaderProgram2.h:69
vtkDepthPeelingPass::OpaqueShadowTexUnit
int OpaqueShadowTexUnit
Definition: vtkDepthPeelingPass.h:216
vtkDepthPeelingPass::IsChecked
bool IsChecked
Definition: vtkDepthPeelingPass.h:158
vtkShader2
GLSL Shader.
Definition: vtkShader2.h:63
vtkDepthPeelingPass::Render
virtual void Render(const vtkRenderState *s)
Perform rendering according to a render state s.
vtkDepthPeelingPass::ViewportWidth
int ViewportWidth
Definition: vtkDepthPeelingPass.h:167
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:42
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:41
vtkDepthPeelingPass::SetTranslucentPass
virtual void SetTranslucentPass(vtkRenderPass *translucentPass)
vtkDepthPeelingPass::MaximumNumberOfPeels
int MaximumNumberOfPeels
In case of depth peeling, define the maximum number of peeling layers.
Definition: vtkDepthPeelingPass.h:193
vtkDepthPeelingPass::CheckTime
vtkTimeStamp CheckTime
Definition: vtkDepthPeelingPass.h:157
vtkDepthPeelingPass::OcclusionRatio
double OcclusionRatio
In case of use of depth peeling technique for rendering translucent material, define the threshold un...
Definition: vtkDepthPeelingPass.h:186
vtkRenderPass
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:59