VTK
vtkShadowMapPass.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=========================================================================*/
41#ifndef vtkShadowMapPass_h
42#define vtkShadowMapPass_h
43
44#include "vtkRenderingOpenGL2Module.h" // For export macro
45#include "vtkRenderPass.h"
46#include <vector> // STL Header
47#include <string> // For member variables.
48
51class vtkCamera;
52class vtkLight;
54class vtkShadowMapPassTextures; // internal
55class vtkShadowMapPassLightCameras; // internal
59
60class VTKRENDERINGOPENGL2_EXPORT vtkShadowMapPass : public vtkRenderPass
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent);
66
71 virtual void Render(const vtkRenderState *s);
72
79
81
87 vtkGetObjectMacro(ShadowMapBakerPass,vtkShadowMapBakerPass);
89 vtkShadowMapBakerPass *shadowMapBakerPass);
91
93
97 vtkGetObjectMacro(OpaqueSequence,vtkRenderPass);
98 virtual void SetOpaqueSequence(vtkRenderPass *opaqueSequence);
100
105 std::vector<double> ShadowMapTransforms() {
106 return this->ShadowTransforms; }
107
113 std::vector<int> GetShadowMapTextureUnits() {
114 return this->ShadowTextureUnits; }
115
120
126 return this->FragmentDeclaration; }
128 return this->FragmentImplementation; }
129
135
136 protected:
141
146
152
153 vtkShadowMapBakerPass *ShadowMapBakerPass;
154 vtkRenderPass *CompositeRGBAPass;
155
157
161 vtkFrameBufferObject *FrameBufferObject;
162
163 vtkShadowMapPassTextures *ShadowMaps;
164 vtkShadowMapPassLightCameras *LightCameras;
165
166 vtkTimeStamp LastRenderTime;
167
168 // to store the shader code and settings
172 std::vector<int> ShadowTextureUnits;
173 std::vector<double> ShadowTransforms;
174 std::vector<float> ShadowAttenuation;
175
176private:
177 vtkShadowMapPass(const vtkShadowMapPass&) VTK_DELETE_FUNCTION;
178 void operator=(const vtkShadowMapPass&) VTK_DELETE_FUNCTION;
179};
180
181#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.
Key for vtkObjectBase values.
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.
The ShaderProgram uses one or more Shader objects.
Implement a builder of shadow map pass.
Implement a shadow mapping render pass.
std::vector< int > ShadowTextureUnits
std::vector< float > ShadowAttenuation
virtual ~vtkShadowMapPass()
Destructor.
std::string FragmentDeclaration
static vtkShadowMapPass * New()
void SetUniforms(vtkShaderProgram *program)
A mapper can call this to set the uniforms that this pass uses.
std::vector< int > GetShadowMapTextureUnits()
get the texture units for the shadow maps for each light.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void ReleaseGraphicsResources(vtkWindow *w)
Release graphics resources and ask components to release their own resources.
virtual void Render(const vtkRenderState *s)
Perform rendering according to a render state s.
std::string FragmentImplementation
vtkRenderPass * OpaqueSequence
virtual void SetOpaqueSequence(vtkRenderPass *opaqueSequence)
void CheckSupport(vtkOpenGLRenderWindow *w)
Check if shadow mapping is supported by the current OpenGL context.
virtual void SetShadowMapBakerPass(vtkShadowMapBakerPass *shadowMapBakerPass)
static vtkInformationObjectBaseKey * ShadowMapPass()
this key will contain the shadow map pass
void BuildShaderCode()
std::string GetFragmentDeclaration()
Get the shader code to compute light factors based on a mappers vertexVC variable.
std::vector< double > ShadowTransforms
std::vector< double > ShadowMapTransforms()
get the matricies for all the shadow maps.
std::string GetFragmentImplementation()
vtkShadowMapPass()
Default constructor.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ string
Definition: vtkX3D.h:490