ComputerGraphik TU WIEN
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Sun Class Reference

#include <sun.hpp>

Inheritance diagram for Sun:
Light SceneObject

Classes

class  EffectObjectAmbientPass
 
class  EffectObjectCube
 
class  EffectObjectCubeInstanced
 
class  EffectObjectSVPass
 

Public Member Functions

 Sun (const std::string &name, Scene *scene=0, Model *model=0, Shader *shader=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 Construct new sun. More...
 
virtual ~Sun ()
 
void draw () const
 
void reset ()
 
void update (double deltaT)
 
void setShader (Shader *val)
 
void drawOmni () const
 
void setUpAmbientPass ()
 
void ambientPass ()
 
void SVPass ()
 
void setUpColorTexture ()
 
void setUpDepthTexture ()
 
GLuint getDepthTexture () const
 
- Public Member Functions inherited from Light
 Light (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 Construct new light. More...
 
virtual ~Light ()
 
glm::vec3 getPower () const
 
glm::vec3 getDiffuse () const
 
glm::vec3 getAmbient () const
 
glm::vec3 getSpecular () const
 
glm::vec3 getPosition () const
 
void setPower (const glm::vec3 &val)
 
void setDiffuse (const glm::vec3 &val)
 
void setAmbient (const glm::vec3 &val)
 
void setSpecular (const glm::vec3 &val)
 
- Public Member Functions inherited from SceneObject
 SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1))
 
 SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 
virtual ~SceneObject ()
 
ModelgetModel () const
 
ShadergetShader () const
 
glm::mat4 getModelMatrix () const
 
glm::mat4 getGlobalModelMatrix () const
 
std::string getName () const
 
std::shared_ptr< SceneObjectgetParent () const
 
void setAnimationTime (double time)
 
bool setAnimation (const Animation &anim)
 
bool delChild (size_t idx)
 
bool getChild (size_t idx, std::shared_ptr< SceneObject > &child) const
 
bool addChild (std::shared_ptr< SceneObject > &child)
 
bool remEffect (const std::string &name)
 
SceneObjectgetEffect (const std::string &name) const
 
bool addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect)
 
bool doNotRender ()
 
bool getIsVolSun ()
 
virtual bool animate (double time)
 

Private Member Functions

void setViewMatrices ()
 

Private Attributes

GLuint frameBuffer
 
GLuint depthTexture
 
GLuint colorTexture
 
GLuint cubeTexture
 
std::vector< glm::mat4 > viewMatrices
 
int renderPasses
 
GLenum cubeFaces [6]
 

Friends

class EffectObjectAmbientPass
 
class EffectObjectSVPass
 
class EffectObjectCube
 
class EffectObjectCubeInstanced
 

Additional Inherited Members

- Public Types inherited from SceneObject
typedef std::vector< std::pair< double, glm::mat4 > > Animation
 
- Protected Attributes inherited from Light
glm::vec3 power
 
glm::vec3 diffuse
 
glm::vec3 ambient
 
glm::vec3 specular
 
- Protected Attributes inherited from SceneObject
GLuint vao
 
Scenescene
 
Modelmodel
 
Shadershader
 
glm::mat4 modelMatrix
 
std::string name
 
std::weak_ptr< SceneObjectparent
 
std::vector< std::shared_ptr< SceneObject > > childs
 
std::map< std::string, std::unique_ptr< SceneObject > > effectChilds
 
size_t animIDX
 
Animation animation
 
bool norender
 
bool isVolSun
 

Detailed Description

Implements the sun in the scene together with shadow mapping techniques.

Author
Felix

The Sun is a derivation of the Light class which is itself a SceneObject. In addition to the methods from SceneObject, a Sun has methods that use different shadow mapping techniques. The method drawOmni supports Omnidirectional Shadow mapping where every SceneObject is rendered into a cubemap texture. This texture will then be used for the shadow map lookup. In addition, we implemented Shadow volumes and therefore 2 renderpasses are used. The method ambientPass and SVPass compute the shadow volumes using each SceneObject in the 2 seperate renderpasses. For each seperate renderpass, effectobjects are used that are passed onwards to the individual SceneObjects that will be rendered. Framebuffer Objects are used for storing different shadow textures.

Todo:
fix documentation

Constructor & Destructor Documentation

Sun::Sun ( const std::string &  name,
Scene scene = 0,
Model model = 0,
Shader shader = 0,
const glm::mat4 &  modelMatrix = glm::mat4(1) 
)

Construct new sun.

Sun::~Sun ( )
virtual

Member Function Documentation

void Sun::ambientPass ( )
void Sun::draw ( ) const
virtual

Reimplemented from SceneObject.

void Sun::drawOmni ( ) const
GLuint Sun::getDepthTexture ( ) const
inline
void Sun::reset ( )
virtual

Reimplemented from SceneObject.

void Sun::setShader ( Shader val)
virtual

Reimplemented from SceneObject.

void Sun::setUpAmbientPass ( )
void Sun::setUpColorTexture ( )
void Sun::setUpDepthTexture ( )
void Sun::setViewMatrices ( )
private
void Sun::SVPass ( )
void Sun::update ( double  deltaT)
virtual

Reimplemented from SceneObject.

Friends And Related Function Documentation

friend class EffectObjectAmbientPass
friend
friend class EffectObjectCube
friend
friend class EffectObjectCubeInstanced
friend
friend class EffectObjectSVPass
friend

Member Data Documentation

GLuint Sun::colorTexture
private
GLenum Sun::cubeFaces[6]
private
GLuint Sun::cubeTexture
private
GLuint Sun::depthTexture
private
GLuint Sun::frameBuffer
private
int Sun::renderPasses
private
std::vector<glm::mat4> Sun::viewMatrices
private

The documentation for this class was generated from the following files: