Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::Effects::CameraBuffer Class Reference

#include <camerabuffer.hpp>

Inheritance diagram for Tucano::Effects::CameraBuffer:
Tucano::Effect

Public Member Functions

 CameraBuffer (void)
 Default constructor. More...
 
void setNumAttachs (int nt)
 Set number of render targets. More...
 
virtual void initialize (void)
 Initializes the CameraBuffer effects,. More...
 
void clearBuffer (void)
 
Tucano::FramebuffergetFbo (void)
 Returns a pointer to the camera coordinates 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::FramebuffergetFboMultisample (void)
 Returns a pointer to the multisampled camera coords map. More...
 
void setNumSamples (int n)
 Set the number of samples for multisampling. More...
 
void renderBuffer (const Tucano::Camera &camera, int attach=0)
 Renders the buffers, usually useful for visual debugging. More...
 
void render (Tucano::Mesh &mesh, const Tucano::Camera &camera, int target=0, const Eigen::Vector4f &buffer_viewport=Eigen::Vector4f(0, 0, 0, 0))
 Creates the camera coordinates buffer. More...
 
- Public Member Functions inherited from Tucano::Effect
 Effect (string shadersDir="shaders/")
 Default constructor. More...
 
virtual ShaderloadShader (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 ShaderloadShader (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 camera coordiantes map, this is using multisampling. More...
 
Tucano::Framebuffer aa_fbo
 A auxiliary fbo to blit multisampled fbo, this is without multisampling. More...
 
Tucano::Shader camerabuffer_shader
 Creates the camera buffer by rendering from given camera. More...
 
Tucano::Shader drawbuffer_shader
 Shader to render the camera coordinates buffer. More...
 
Tucano::Mesh quad
 Quad for rendering buffer, mostly for debug. More...
 
int num_samples = 1
 Number of multisamples, if 1, no multisamping. More...
 
int num_attachs = 1
 Numer of render targets. 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...
 

Detailed Description

Renders a buffer with camera coordinates The FBO may be set to multiple render targets, so many meshes can be rendered in different targets if necessary without creating more effects or FBOs

Constructor & Destructor Documentation

Tucano::Effects::CameraBuffer::CameraBuffer ( void  )
inline

Default constructor.

Member Function Documentation

void Tucano::Effects::CameraBuffer::clearBuffer ( void  )
inline
Tucano::Framebuffer* Tucano::Effects::CameraBuffer::getFbo ( void  )
inline

Returns a pointer to the camera coordinates 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.

Returns
Pointer to the camera buffer with single sampling
Tucano::Framebuffer* Tucano::Effects::CameraBuffer::getFboMultisample ( void  )
inline

Returns a pointer to the multisampled camera coords map.

Returns
Pointer to multisample buffer
virtual void Tucano::Effects::CameraBuffer::initialize ( void  )
inlinevirtual

Initializes the CameraBuffer effects,.

Implements Tucano::Effect.

void Tucano::Effects::CameraBuffer::render ( Tucano::Mesh mesh,
const Tucano::Camera camera,
int  target = 0,
const Eigen::Vector4f &  buffer_viewport = Eigen::Vector4f(0,0,0,0) 
)
inline

Creates the camera coordinates buffer.

Parameters
meshMesh to be rendered.
cameraA pointer to the camera object.
void Tucano::Effects::CameraBuffer::renderBuffer ( const Tucano::Camera camera,
int  attach = 0 
)
inline

Renders the buffers, usually useful for visual debugging.

Parameters
cameraThe camera to render from
void Tucano::Effects::CameraBuffer::setNumAttachs ( int  nt)
inline

Set number of render targets.

Parameters
ntNumber of rendertargets for FBO
void Tucano::Effects::CameraBuffer::setNumSamples ( int  n)
inline

Set the number of samples for multisampling.

Parameters
nGiven number of samples

Member Data Documentation

Tucano::Framebuffer Tucano::Effects::CameraBuffer::aa_fbo
protected

A auxiliary fbo to blit multisampled fbo, this is without multisampling.

Tucano::Shader Tucano::Effects::CameraBuffer::camerabuffer_shader
protected

Creates the camera buffer by rendering from given camera.

Tucano::Shader Tucano::Effects::CameraBuffer::drawbuffer_shader
protected

Shader to render the camera coordinates buffer.

Tucano::Framebuffer Tucano::Effects::CameraBuffer::fbo
protected

Framebuffer to store the camera coordiantes map, this is using multisampling.

int Tucano::Effects::CameraBuffer::num_attachs = 1
protected

Numer of render targets.

int Tucano::Effects::CameraBuffer::num_samples = 1
protected

Number of multisamples, if 1, no multisamping.

Tucano::Mesh Tucano::Effects::CameraBuffer::quad
protected

Quad for rendering buffer, mostly for debug.


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