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 =========================================================================*/
45 #ifndef vtkShadowMapBakerPass_h
46 #define vtkShadowMapBakerPass_h
47 
48 #include "vtkRenderingOpenGLModule.h" // For export macro
49 #include "vtkRenderPass.h"
50 
53 class vtkCamera;
54 class vtkLight;
56 class vtkShadowMapBakerPassTextures; // internal
57 class vtkShadowMapBakerPassLightCameras; // internal
58 
59 class VTKRENDERINGOPENGL_EXPORT vtkShadowMapBakerPass : public vtkRenderPass
60 {
61 public:
62  static vtkShadowMapBakerPass *New();
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
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 
76  //BTX
78 
80  virtual void Render(const vtkRenderState *s);
81  //ETX
83 
87 
89 
93  vtkGetObjectMacro(OpaquePass,vtkRenderPass);
94  virtual void SetOpaquePass(vtkRenderPass *opaquePass);
96 
98 
102  vtkGetObjectMacro(CompositeZPass,vtkRenderPass);
103  virtual void SetCompositeZPass(vtkRenderPass *compositeZPass);
105 
107 
110  vtkSetMacro(Resolution,unsigned int);
111  vtkGetMacro(Resolution,unsigned int);
113 
115 
123  vtkSetMacro(PolygonOffsetFactor,float);
124  vtkGetMacro(PolygonOffsetFactor,float);
126 
128 
137  vtkSetMacro(PolygonOffsetUnits,float);
138  vtkGetMacro(PolygonOffsetUnits,float);
140 
144  bool GetHasShadows();
145 
150  bool LightCreatesShadow(vtkLight *l);
151 
152 //BTX
155  vtkShadowMapBakerPassTextures *GetShadowMaps();
156 
158 
160  vtkShadowMapBakerPassLightCameras *GetLightCameras();
161 //ETX
163 
168  bool GetNeedUpdate();
169 
170  // // Description:
171  // INTERNAL USE ONLY.
172  // Internally used by vtkShadowMapBakerPass and vtkShadowMapPass.
173  //
174  // Set NeedUpate to false. Called by vtkShadowMapPass.
175  void SetUpToDate();
176 
177  protected:
180 
182  virtual ~vtkShadowMapBakerPass();
183 
185 
188  void PointNearFar(double *v,
189  double *pt,
190  double *dir,
191  double &mNear,
192  double &mFar,
193  bool initialized);
195 
197 
199  void BoxNearFar(double *bb,
200  double *pt,
201  double *dir,
202  double &mNear,
203  double &mFar);
205 
206  //BTX
208 
210  void BuildCameraLight(vtkLight *light,
211  double *boundingBox,
212  vtkCamera *lcamera);
213  //ETX
215 
218  void CheckSupport(vtkOpenGLRenderWindow *w);
219 
221 
223 
224  unsigned int Resolution;
225 
228 
230 
233 
236 
237 
240 
241 private:
242  vtkShadowMapBakerPass(const vtkShadowMapBakerPass&); // Not implemented.
243  void operator=(const vtkShadowMapBakerPass&); // Not implemented.
244 };
245 
246 #endif
OpenGL rendering window.
vtkShadowMapBakerPassTextures * ShadowMaps
record modification and/or execution time
Definition: vtkTimeStamp.h:34
void PrintSelf(ostream &os, vtkIndent indent)
vtkShadowMapBakerPassLightCameras * LightCameras
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
Context in which a vtkRenderPass will render.
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
Key for integer values in vtkInformation.
a virtual light for 3D rendering
Definition: vtkLight.h:60
internal class which encapsulates OpenGL frame buffer object. Not to be used directly.
virtual void Render(const vtkRenderState *s)=0
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkFrameBufferObject * FrameBufferObject
static vtkObject * New()
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:57
Implement a builder of shadow map pass.