VTK  9.0.1
vtkEDLShading.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VTK
4  Module: vtkEDLShading.h
5 
6  Copyright (c) Sandia Corporation, Kitware Inc.
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 =========================================================================*/
15 /*----------------------------------------------------------------------
16 Acknowledgement:
17 This algorithm is the result of joint work by Electricité de France,
18 CNRS, Collège de France and Université J. Fourier as part of the
19 Ph.D. thesis of Christian BOUCHENY.
20 ------------------------------------------------------------------------*/
39 #ifndef vtkEDLShading_h
40 #define vtkEDLShading_h
41 
42 #define EDL_HIGH_RESOLUTION_ON 1
43 #define EDL_LOW_RESOLUTION_ON 1
44 
46 #include "vtkOpenGLHelper.h" // used for ivars
47 #include "vtkRenderingOpenGL2Module.h" // For export macro
48 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
49 
52 class vtkTextureObject;
53 
54 class VTKRENDERINGOPENGL2_EXPORT vtkEDLShading : public vtkDepthImageProcessingPass
55 {
56 public:
57  static vtkEDLShading* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
65  void Render(const vtkRenderState* s) override;
66 
72  void ReleaseGraphicsResources(vtkWindow* w) override;
73 
74 protected:
78  vtkEDLShading();
79 
83  ~vtkEDLShading() override;
84 
88  void EDLInitializeFramebuffers(vtkRenderState& s);
89 
93  void EDLInitializeShaders(vtkOpenGLRenderWindow*);
94 
98  bool EDLShadeHigh(vtkRenderState& s, vtkOpenGLRenderWindow*);
99 
103  bool EDLShadeLow(vtkRenderState& s, vtkOpenGLRenderWindow*);
104 
108  bool EDLBlurLow(vtkRenderState& s, vtkOpenGLRenderWindow*);
109 
113  bool EDLCompose(const vtkRenderState* s, vtkOpenGLRenderWindow*);
114 
116 
120  // used to record scene data
122  // color render target for projection pass
124  // depth render target for projection pass
126 
127  // Framebuffer objects and textures for EDL
129  // for EDL full res shading
131  // color render target for EDL full res pass
133  // for EDL low res shading (image size/4)
135  // color render target for EDL low res pass
137  // color render target for EDL low res
138  // bilateral filter pass
139 
140  // Shader prohrams
144 
145  float EDLNeighbours[8][4];
147  int EDLLowResFactor; // basically 4
148 
149  float Zn; // near clipping plane
150  float Zf; // far clipping plane
151 
152 private:
153  vtkEDLShading(const vtkEDLShading&) = delete;
154  void operator=(const vtkEDLShading&) = delete;
155 };
156 
157 #endif
vtkDepthImageProcessingPass
Convenient class for post-processing passes. Based on vtkImageProcessingPass, but writes depth as wel...
Definition: vtkDepthImageProcessingPass.h:45
vtkEDLShading::EDLComposeProgram
vtkOpenGLHelper EDLComposeProgram
Definition: vtkEDLShading.h:142
vtkEDLShading::EDLLowFBO
vtkOpenGLFramebufferObject * EDLLowFBO
Definition: vtkEDLShading.h:132
vtkEDLShading::ProjectionColorTexture
vtkTextureObject * ProjectionColorTexture
Definition: vtkEDLShading.h:121
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkEDLShading::EDLHighFBO
vtkOpenGLFramebufferObject * EDLHighFBO
Definition: vtkEDLShading.h:128
vtkRenderPass::Render
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
vtkOpenGLFramebufferObject
Internal class which encapsulates OpenGL FramebufferObject.
Definition: vtkOpenGLFramebufferObject.h:181
vtkOpenGLHelper.h
vtkEDLShading::ProjectionDepthTexture
vtkTextureObject * ProjectionDepthTexture
Definition: vtkEDLShading.h:123
vtkEDLShading::Zn
float Zn
Definition: vtkEDLShading.h:149
vtkImageProcessingPass::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
vtkEDLShading::EDLShadeProgram
vtkOpenGLHelper EDLShadeProgram
Definition: vtkEDLShading.h:141
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkEDLShading::EDLHighShadeTexture
vtkTextureObject * EDLHighShadeTexture
Definition: vtkEDLShading.h:130
vtkEDLShading::Zf
float Zf
Definition: vtkEDLShading.h:150
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:30
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:40
vtkSmartPointer.h
vtkEDLShading::EDLLowResFactor
int EDLLowResFactor
Definition: vtkEDLShading.h:147
vtkEDLShading
Definition: vtkEDLShading.h:54
vtkEDLShading::EDLIsFiltered
bool EDLIsFiltered
Definition: vtkEDLShading.h:146
vtkEDLShading::BilateralProgram
vtkOpenGLHelper BilateralProgram
Definition: vtkEDLShading.h:143
vtkDepthImageProcessingPass::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:51
vtkRenderState
Context in which a vtkRenderPass will render.
Definition: vtkRenderState.h:40
vtkEDLShading::ProjectionFBO
vtkOpenGLFramebufferObject * ProjectionFBO
Framebuffer object and textures for initial projection.
Definition: vtkEDLShading.h:119
vtkEDLShading::EDLLowBlurTexture
vtkTextureObject * EDLLowBlurTexture
Definition: vtkEDLShading.h:136
vtkEDLShading::EDLLowShadeTexture
vtkTextureObject * EDLLowShadeTexture
Definition: vtkEDLShading.h:134
vtkDepthImageProcessingPass.h