VTK
vtkShadowMapBakerPass.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkShadowMapBakerPass.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=========================================================================*/
41#ifndef vtkShadowMapBakerPass_h
42#define vtkShadowMapBakerPass_h
43
44#include "vtkRenderingOpenGL2Module.h" // For export macro
45#include "vtkSmartPointer.h" // for ivars
46#include <vector> // STL Header
47#include "vtkRenderPass.h"
48
51class vtkCamera;
52class vtkLight;
55
56class VTKRENDERINGOPENGL2_EXPORT vtkShadowMapBakerPass : public vtkRenderPass
57{
58public:
61 void PrintSelf(ostream& os, vtkIndent indent);
62
67 virtual void Render(const vtkRenderState *s);
68
75
77
83 vtkGetObjectMacro(OpaqueSequence,vtkRenderPass);
84 virtual void SetOpaqueSequence(vtkRenderPass *opaqueSequence);
86
88
94 vtkGetObjectMacro(CompositeZPass,vtkRenderPass);
95 virtual void SetCompositeZPass(vtkRenderPass *compositeZPass);
97
99
104 vtkSetMacro(Resolution,unsigned int);
105 vtkGetMacro(Resolution,unsigned int);
107
116
127
134 std::vector<vtkSmartPointer<vtkTextureObject> > *GetShadowMaps();
135
142 std::vector<vtkSmartPointer<vtkCamera> > *GetLightCameras();
143
153
154 // // Description:
155 // INTERNAL USE ONLY.
156 // Internally used by vtkShadowMapBakerPass and vtkShadowMapPass.
157 //
158 // Set NeedUpate to false. Called by vtkShadowMapPass.
160
161 protected:
166
171
179 void PointNearFar(double *v,
180 double *pt,
181 double *dir,
182 double &mNear,
183 double &mFar,
184 bool initialized);
185
192 void BoxNearFar(double *bb,
193 double *pt,
194 double *dir,
195 double &mNear,
196 double &mFar);
197
204 double *boundingBox,
205 vtkCamera *lcamera);
206
212
214
215 vtkRenderPass *CompositeZPass;
216
217 unsigned int Resolution;
218
219 bool HasShadows;
220
224 vtkFrameBufferObject *FrameBufferObject;
225
226 std::vector<vtkSmartPointer<vtkTextureObject> > *ShadowMaps;
227 std::vector<vtkSmartPointer<vtkCamera> > *LightCameras;
228
229
230 vtkTimeStamp LastRenderTime;
231 bool NeedUpdate;
232
233private:
234 vtkShadowMapBakerPass(const vtkShadowMapBakerPass&) VTK_DELETE_FUNCTION;
235 void operator=(const vtkShadowMapBakerPass&) VTK_DELETE_FUNCTION;
236};
237
238#endif
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
internal class which encapsulates OpenGL frame buffer object.
a simple class to control print indentation
Definition: vtkIndent.h:40
Key for integer values in vtkInformation.
a virtual light for 3D rendering
Definition: vtkLight.h:62
OpenGL rendering window.
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:59
Context in which a vtkRenderPass will render.
Implement a builder of shadow map pass.
vtkShadowMapBakerPass()
Default constructor.
void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
virtual void SetOpaqueSequence(vtkRenderPass *opaqueSequence)
void CheckSupport(vtkOpenGLRenderWindow *w)
Check if shadow mapping is supported by the current OpenGL context.
std::vector< vtkSmartPointer< vtkCamera > > * LightCameras
void BoxNearFar(double *bb, double *pt, double *dir, double &mNear, double &mFar)
Compute the min/max of the projection of a box in a given direction.
bool LightCreatesShadow(vtkLight *l)
INTERNAL USE ONLY.
virtual void Render(const vtkRenderState *s)
Perform rendering according to a render state s.
void PointNearFar(double *v, double *pt, double *dir, double &mNear, double &mFar, bool initialized)
Helper method to compute the mNearest point in a given direction.
bool GetHasShadows()
INTERNAL USE ONLY.
std::vector< vtkSmartPointer< vtkTextureObject > > * GetShadowMaps()
INTERNAL USE ONLY Internally used by vtkShadowMapBakerPass and vtkShadowMapPass.
void BuildCameraLight(vtkLight *light, double *boundingBox, vtkCamera *lcamera)
Build a camera from spot light parameters.
static vtkShadowMapBakerPass * New()
std::vector< vtkSmartPointer< vtkCamera > > * GetLightCameras()
INTERNAL USE ONLY.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual ~vtkShadowMapBakerPass()
Destructor.
bool GetNeedUpdate()
INTERNAL USE ONLY.
std::vector< vtkSmartPointer< vtkTextureObject > > * ShadowMaps
virtual void SetCompositeZPass(vtkRenderPass *compositeZPass)
abstracts an OpenGL texture object.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ dir
Definition: vtkX3D.h:324
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.