VTK  9.3.20240418
vtkEDLShading.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation, Kitware Inc
3 // SPDX-License-Identifier: BSD-3-Clause
4 /*----------------------------------------------------------------------
5 Acknowledgement:
6 This algorithm is the result of joint work by Electricité de France,
7 CNRS, Collège de France and Université J. Fourier as part of the
8 Ph.D. thesis of Christian BOUCHENY.
9 ------------------------------------------------------------------------*/
31 #ifndef vtkEDLShading_h
32 #define vtkEDLShading_h
33 
34 #define EDL_HIGH_RESOLUTION_ON 1
35 #define EDL_LOW_RESOLUTION_ON 1
36 
38 #include "vtkOpenGLHelper.h" // used for ivars
39 #include "vtkRenderingOpenGL2Module.h" // For export macro
40 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
41 
42 VTK_ABI_NAMESPACE_BEGIN
45 class vtkTextureObject;
46 
47 class VTKRENDERINGOPENGL2_EXPORT vtkEDLShading : public vtkDepthImageProcessingPass
48 {
49 public:
50  static vtkEDLShading* New();
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
58  void Render(const vtkRenderState* s) override;
59 
66 
67 protected:
72 
76  ~vtkEDLShading() override;
77 
82 
87 
92 
97 
102 
107 
109 
113  // used to record scene data
115  // color render target for projection pass
117  // depth render target for projection pass
119 
120  // Framebuffer objects and textures for EDL
122  // for EDL full res shading
124  // color render target for EDL full res pass
126  // for EDL low res shading (image size/4)
128  // color render target for EDL low res pass
130  // color render target for EDL low res
131  // bilateral filter pass
132 
133  // Shader prohrams
137 
138  float EDLNeighbours[8][4];
140  int EDLLowResFactor; // basically 4
141 
142  float Zn; // near clipping plane
143  float Zf; // far clipping plane
144 
145 private:
146  vtkEDLShading(const vtkEDLShading&) = delete;
147  void operator=(const vtkEDLShading&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
Convenient class for post-processing passes.
Implement an EDL offscreen shading.
Definition: vtkEDLShading.h:48
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool EDLCompose(const vtkRenderState *s, vtkOpenGLRenderWindow *)
Compose color and shaded images.
vtkOpenGLHelper EDLComposeProgram
vtkTextureObject * EDLLowBlurTexture
void EDLInitializeShaders(vtkOpenGLRenderWindow *)
Initialization of required GLSL shaders.
vtkEDLShading()
Default constructor.
~vtkEDLShading() override
Destructor.
void EDLInitializeFramebuffers(vtkRenderState &s)
Initialization of required framebuffer objects.
vtkOpenGLFramebufferObject * EDLHighFBO
bool EDLBlurLow(vtkRenderState &s, vtkOpenGLRenderWindow *)
Render EDL in middle resolution buffer.
vtkOpenGLHelper EDLShadeProgram
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
vtkTextureObject * ProjectionDepthTexture
Framebuffer object and textures for initial projection.
bool EDLShadeLow(vtkRenderState &s, vtkOpenGLRenderWindow *)
Render EDL in middle resolution buffer.
vtkTextureObject * EDLLowShadeTexture
vtkTextureObject * EDLHighShadeTexture
void Render(const vtkRenderState *s) override
Perform rendering according to a render state s.
bool EDLShadeHigh(vtkRenderState &s, vtkOpenGLRenderWindow *)
Render EDL in full resolution buffer.
static vtkEDLShading * New()
vtkOpenGLHelper BilateralProgram
vtkOpenGLFramebufferObject * EDLLowFBO
vtkTextureObject * ProjectionColorTexture
Framebuffer object and textures for initial projection.
vtkOpenGLFramebufferObject * ProjectionFBO
Framebuffer object and textures for initial projection.
a simple class to control print indentation
Definition: vtkIndent.h:108
Internal class which encapsulates OpenGL FramebufferObject.
OpenGL rendering window.
Context in which a vtkRenderPass will render.
abstracts an OpenGL texture object.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48