29#ifndef __ShadowCameraSetupFocused_H__
30#define __ShadowCameraSetupFocused_H__
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
Holds a solid representation of a convex body.
Internal class holding a point list representation of a convex body.
void reset(void)
Resets the body.
size_t getPointCount(void) const
Returns the point count.
void merge(const PointListBody &plb)
Merges a second PointListBody into this one.
void buildAndIncludeDirection(const ConvexBody &body, Real extrudeDist, const Vector3 &dir)
Builds a PointListBody from a Body and includes all the space in a given direction.
const Vector3 & getPoint(size_t cnt) const
Returns a point.
void addPoint(const Vector3 &point)
Adds a specific point to the body list.
Polygon::VertexList mBodyPoints
const AxisAlignedBox & getAAB(void) const
Returns the bounding box representation.
PointListBody(const ConvexBody &body)
void build(const ConvexBody &body, bool filterDuplicates=true)
Builds a point list body from a 'real' body.
void addAAB(const AxisAlignedBox &aab)
Adds all points of an AAB.
Implements the uniform shadow mapping algorithm in focused mode.
virtual void getShadowCamera(const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const
Returns a uniform shadow camera with a focused view.
Frustum * mTempFrustum
Temporary preallocated frustum to set up a projection matrix in calculateShadowMappingMatrix().
bool mLightFrustumCameraCalculated
Camera * mLightFrustumCamera
Temporary preallocated camera to set up a light frustum for clipping in FocusedShadowCameraSetup::cal...
static const Matrix4 msNormalToLightSpace
Transform to or from light space as defined by Wimmer et al.
Vector3 getLSProjViewDir(const Matrix4 &lightSpace, const Camera &cam, const PointListBody &bodyLVS) const
Returns the projection view direction.
static const Matrix4 msLightSpaceToNormal
PointListBody mPointListBodyLVS
Matrix4 transformToUnitCube(const Matrix4 &m, const PointListBody &body) const
Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific shadow matrix enable...
PointListBody mPointListBodyB
void calculateShadowMappingMatrix(const SceneManager &sm, const Camera &cam, const Light &light, Matrix4 *out_view, Matrix4 *out_proj, Camera *out_cam) const
Calculates the standard shadow mapping matrix.
virtual ~FocusedShadowCameraSetup(void)
Default destructor.
bool mUseAggressiveRegion
Use tighter focus region?
Vector3 getNearCameraPoint_ws(const Matrix4 &viewMatrix, const PointListBody &bodyLVS) const
Returns a valid near-point seen by the camera.
bool getUseAggressiveFocusRegion() const
void calculateB(const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, const AxisAlignedBox &receiverBB, PointListBody *out_bodyB) const
Calculates the intersection bodyB.
FocusedShadowCameraSetup(void)
Default constructor.
void setUseAggressiveFocusRegion(bool aggressive)
Sets whether or not to use the more aggressive approach to deciding on the focus region or not.
Matrix4 buildViewMatrix(const Vector3 &pos, const Vector3 &dir, const Vector3 &up) const
Builds a view matrix.
void calculateLVS(const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, PointListBody *out_LVS) const
Calculates the bodyLVS.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Representation of a dynamic light source in the scene.
Class encapsulating a standard 4x4 homogeneous matrix.
Manages the organisation and rendering of a 'scene' i.e.
This class allows you to plug in new ways to define the camera setup when rendering and projecting sh...
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 3-dimensional vector.
An abstraction of a viewport, i.e.