VTK
vtkShadowMapBakerPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkShadowMapPass.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 =========================================================================*/
43 #ifndef vtkShadowMapBakerPass_h
44 #define vtkShadowMapBakerPass_h
45 
46 #include "vtkRenderingOpenGLModule.h" // For export macro
47 #include "vtkRenderPass.h"
48 
51 class vtkCamera;
52 class vtkLight;
54 class vtkShadowMapBakerPassTextures; // internal
55 class vtkShadowMapBakerPassLightCameras; // internal
56 
57 class VTKRENDERINGOPENGL_EXPORT vtkShadowMapBakerPass : public vtkRenderPass
58 {
59 public:
60  static vtkShadowMapBakerPass *New();
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
69  static vtkInformationIntegerKey *OCCLUDER();
70 
71  // If this key exists on the Propertykeys of a prop, the prop is viewed as a
72  // light/shadow receiver. This key is not mutually exclusive with the
73  // OCCLUDER() key.
74  static vtkInformationIntegerKey *RECEIVER();
75 
80  virtual void Render(const vtkRenderState *s);
81 
88 
90 
97  vtkGetObjectMacro(OpaquePass,vtkRenderPass);
98  virtual void SetOpaquePass(vtkRenderPass *opaquePass);
100 
102 
108  vtkGetObjectMacro(CompositeZPass,vtkRenderPass);
109  virtual void SetCompositeZPass(vtkRenderPass *compositeZPass);
111 
113 
118  vtkSetMacro(Resolution,unsigned int);
119  vtkGetMacro(Resolution,unsigned int);
121 
123 
133  vtkSetMacro(PolygonOffsetFactor,float);
134  vtkGetMacro(PolygonOffsetFactor,float);
136 
138 
150  vtkSetMacro(PolygonOffsetUnits,float);
151  vtkGetMacro(PolygonOffsetUnits,float);
153 
161  bool GetHasShadows();
162 
172  bool LightCreatesShadow(vtkLight *l);
173 
180  vtkShadowMapBakerPassTextures *GetShadowMaps();
181 
188  vtkShadowMapBakerPassLightCameras *GetLightCameras();
189 
198  bool GetNeedUpdate();
199 
200  // // Description:
201  // INTERNAL USE ONLY.
202  // Internally used by vtkShadowMapBakerPass and vtkShadowMapPass.
203  //
204  // Set NeedUpate to false. Called by vtkShadowMapPass.
205  void SetUpToDate();
206 
207  protected:
212 
216  virtual ~vtkShadowMapBakerPass();
217 
225  void PointNearFar(double *v,
226  double *pt,
227  double *dir,
228  double &mNear,
229  double &mFar,
230  bool initialized);
231 
238  void BoxNearFar(double *bb,
239  double *pt,
240  double *dir,
241  double &mNear,
242  double &mFar);
243 
249  void BuildCameraLight(vtkLight *light,
250  double *boundingBox,
251  vtkCamera *lcamera);
252 
257  void CheckSupport(vtkOpenGLRenderWindow *w);
258 
260 
262 
263  unsigned int Resolution;
264 
267 
269 
274 
277 
278 
281 
282 private:
283  vtkShadowMapBakerPass(const vtkShadowMapBakerPass&) VTK_DELETE_FUNCTION;
284  void operator=(const vtkShadowMapBakerPass&) VTK_DELETE_FUNCTION;
285 };
286 
287 #endif
OpenGL rendering window.
vtkShadowMapBakerPassTextures * ShadowMaps
record modification and/or execution time
Definition: vtkTimeStamp.h:35
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkShadowMapBakerPassLightCameras * LightCameras
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
Key for integer values in vtkInformation.
a virtual light for 3D rendering
Definition: vtkLight.h:61
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
internal class which encapsulates OpenGL frame buffer object.
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
virtual void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
vtkFrameBufferObject * FrameBufferObject
Graphics resources.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:58
Implement a builder of shadow map pass.