Tucano
0.1
A library for rapid prototyping with modern OpenGL and GLSL
|
#include <shadowmap.hpp>
Public Member Functions | |
ShadowMap (void) | |
Default constructor. More... | |
virtual void | initialize (void) |
Initializes the ShadowMap effects,. More... | |
void | clearShadowBuffer (void) |
Tucano::Framebuffer * | getShadowMap (void) |
Returns a pointer to the shadow map with single sampling Note that if multisapling is used (num samples > 1) a blit operation is performed, and the single sampled map is returned. More... | |
Tucano::Framebuffer * | getShadowMapMultisample (void) |
Returns a pointer to the multisampled shadow map. More... | |
void | setNumSamples (int n) |
Set the number of samples for multisampling. More... | |
void | setBufferSize (const Eigen::Vector2i &size) |
Set the shadow buffer size. More... | |
void | createBuffers (void) |
Creates FBOs, or recreates when size changes. More... | |
void | renderBuffer (const Tucano::Camera &camera) |
void | render (Tucano::Mesh &mesh, const Tucano::Camera &camera, const Tucano::Camera &light) |
Composes the shadow depth buffer. More... | |
Public Member Functions inherited from Tucano::Effect | |
Effect (string shadersDir="shaders/") | |
Default constructor. More... | |
virtual Shader * | loadShader (string shader_name) |
Loads a shader by filename, initializes it, and inserts in shaders list. More... | |
virtual void | loadShader (Shader &shader, string shader_name) |
virtual Shader * | loadShader (string shader_name, string vertex_name, string frag_name, string geom_name) |
Loads a shader by complete filenames (with extensions), initializes it, and inserts in shaders list. More... | |
void | setShadersDir (string dir) |
virtual void | reloadShaders (void) |
Reloads all shaders needed for effect usage. More... | |
Protected Attributes | |
Tucano::Framebuffer | fbo |
Framebuffer to store the shadow depth map, this is using multisampling. More... | |
Tucano::Framebuffer | aa_fbo |
A auxiliary fbo to blit multisampled fbo. More... | |
Tucano::Shader | shadowbuffer_shader |
Creates the shadowmap depth buffer by rendering from light pos. More... | |
Tucano::Shader | drawbuffer_shader |
Shader to render shadow map. More... | |
Tucano::Mesh | quad |
Quad for rendering shadow map, mostly for debug. More... | |
Eigen::Vector2i | viewport = Eigen::Vector2i(1024, 1024) |
Shadowbuffer size. More... | |
int | depth_tex_id = 0 |
int | num_samples = 4 |
bool | recreate_fbo = true |
Flag to recreate buffer during next render. More... | |
Protected Attributes inherited from Tucano::Effect | |
std::vector< Shader * > | shaders_list |
Vector of pointers to shaders used in this effect, in case the user needs multiple pass rendering. More... | |
string | shaders_dir |
Directory in which the shader files are stored. More... | |
Simple Shadow Mapping Renders depth buffer from light position to compute the shadow map
|
inline |
Default constructor.
|
inline |
|
inline |
Creates FBOs, or recreates when size changes.
|
inline |
Returns a pointer to the shadow map with single sampling Note that if multisapling is used (num samples > 1) a blit operation is performed, and the single sampled map is returned.
|
inline |
Returns a pointer to the multisampled shadow map.
|
inlinevirtual |
Initializes the ShadowMap effects,.
Implements Tucano::Effect.
|
inline |
Composes the shadow depth buffer.
mesh | Mesh to be rendered. |
camera | A pointer to the camera trackball object. |
light | A pointer to the light trackball object. |
|
inline |
|
inline |
Set the shadow buffer size.
n | Given size as vector 2i |
|
inline |
Set the number of samples for multisampling.
n | Given number of samples |
|
protected |
A auxiliary fbo to blit multisampled fbo.
|
protected |
|
protected |
Shader to render shadow map.
|
protected |
Framebuffer to store the shadow depth map, this is using multisampling.
|
protected |
|
protected |
Quad for rendering shadow map, mostly for debug.
|
protected |
Flag to recreate buffer during next render.
|
protected |
Creates the shadowmap depth buffer by rendering from light pos.
|
protected |
Shadowbuffer size.