VTK
vtkEDLShading.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VTK
4  Module: vtkEDLShading.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 /*----------------------------------------------------------------------
33 Acknowledgement:
34 This algorithm is the result of joint work by Electricité de France,
35 CNRS, Collège de France and Université J. Fourier as part of the
36 Ph.D. thesis of Christian BOUCHENY.
37 ------------------------------------------------------------------------*/
58 #ifndef vtkEDLShading_h
59 #define vtkEDLShading_h
60 
61 #define EDL_HIGH_RESOLUTION_ON 1
62 #define EDL_LOW_RESOLUTION_ON 1
63 
65 #include "vtkRenderingOpenGL2Module.h" // For export macro
66 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
67 #include "vtkOpenGLHelper.h" // used for ivars
68 
71 class vtkTextureObject;
72 
74 {
75 public:
76  static vtkEDLShading *New();
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
80  //BTX
82 
84  virtual void Render(const vtkRenderState *s);
85  //ETX
87 
91 
92  protected:
94  vtkEDLShading();
95 
97  virtual ~vtkEDLShading();
98 
100  void EDLInitializeFramebuffers(vtkRenderState &s);
101 
103  void EDLInitializeShaders(vtkOpenGLRenderWindow *);
104 
106  bool EDLShadeHigh(vtkRenderState &s, vtkOpenGLRenderWindow *);
107 
109  bool EDLShadeLow(vtkRenderState &s, vtkOpenGLRenderWindow *);
110 
112  bool EDLBlurLow(vtkRenderState &s, vtkOpenGLRenderWindow *);
113 
115  bool EDLCompose(const vtkRenderState *s, vtkOpenGLRenderWindow *);
116 
118 
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&); // Not implemented.
154  void operator=(const vtkEDLShading&); // Not implemented.
155 };
156 
157 #endif
OpenGL rendering window.
vtkTextureObject * ProjectionDepthTexture
vtkTextureObject * EDLLowShadeTexture
vtkTextureObject * EDLHighShadeTexture
#define VTKRENDERINGOPENGL2_EXPORT
vtkFrameBufferObject * EDLHighFBO
vtkOpenGLHelper BilateralProgram
vtkTextureObject * ProjectionColorTexture
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
vtkOpenGLHelper EDLComposeProgram
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkFrameBufferObject * ProjectionFBO
internal class which encapsulates OpenGL frame buffer object. Not to be used directly.
abstracts an OpenGL texture object.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void Render(const vtkRenderState *s)=0
vtkTextureObject * EDLLowBlurTexture
static vtkObject * New()
Convenient class for post-processing passes. Based on vtkImageProcessingPass, but writes depth as wel...
vtkFrameBufferObject * EDLLowFBO
vtkOpenGLHelper EDLShadeProgram
void ReleaseGraphicsResources(vtkWindow *w)