VTK  9.2.6
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 ------------------------------------------------------------------------*/
42 #ifndef vtkEDLShading_h
43 #define vtkEDLShading_h
44 
45 #define EDL_HIGH_RESOLUTION_ON 1
46 #define EDL_LOW_RESOLUTION_ON 1
47 
49 #include "vtkOpenGLHelper.h" // used for ivars
50 #include "vtkRenderingOpenGL2Module.h" // For export macro
51 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
52 
55 class vtkTextureObject;
56 
57 class VTKRENDERINGOPENGL2_EXPORT vtkEDLShading : public vtkDepthImageProcessingPass
58 {
59 public:
60  static vtkEDLShading* New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68  void Render(const vtkRenderState* s) override;
69 
75  void ReleaseGraphicsResources(vtkWindow* w) override;
76 
77 protected:
81  vtkEDLShading();
82 
86  ~vtkEDLShading() override;
87 
91  void EDLInitializeFramebuffers(vtkRenderState& s);
92 
96  void EDLInitializeShaders(vtkOpenGLRenderWindow*);
97 
101  bool EDLShadeHigh(vtkRenderState& s, vtkOpenGLRenderWindow*);
102 
106  bool EDLShadeLow(vtkRenderState& s, vtkOpenGLRenderWindow*);
107 
111  bool EDLBlurLow(vtkRenderState& s, vtkOpenGLRenderWindow*);
112 
116  bool EDLCompose(const vtkRenderState* s, vtkOpenGLRenderWindow*);
117 
119 
123  // used to record scene data
125  // color render target for projection pass
127  // depth render target for projection pass
129 
130  // Framebuffer objects and textures for EDL
132  // for EDL full res shading
134  // color render target for EDL full res pass
136  // for EDL low res shading (image size/4)
138  // color render target for EDL low res pass
140  // color render target for EDL low res
141  // bilateral filter pass
142 
143  // Shader prohrams
147 
148  float EDLNeighbours[8][4];
150  int EDLLowResFactor; // basically 4
151 
152  float Zn; // near clipping plane
153  float Zf; // far clipping plane
154 
155 private:
156  vtkEDLShading(const vtkEDLShading&) = delete;
157  void operator=(const vtkEDLShading&) = delete;
158 };
159 
160 #endif
OpenGL rendering window.
vtkTextureObject * ProjectionDepthTexture
Framebuffer object and textures for initial projection.
vtkTextureObject * EDLLowShadeTexture
Implement an EDL offscreen shading.
Definition: vtkEDLShading.h:57
vtkTextureObject * EDLHighShadeTexture
vtkOpenGLHelper BilateralProgram
vtkTextureObject * ProjectionColorTexture
Framebuffer object and textures for initial projection.
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkOpenGLHelper EDLComposeProgram
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLFramebufferObject * EDLHighFBO
Internal class which encapsulates OpenGL FramebufferObject.
abstracts an OpenGL texture object.
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
vtkTextureObject * EDLLowBlurTexture
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Convenient class for post-processing passes.
vtkOpenGLFramebufferObject * ProjectionFBO
Framebuffer object and textures for initial projection.
vtkOpenGLHelper EDLShadeProgram
vtkOpenGLFramebufferObject * EDLLowFBO