Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
AttributePass Class Reference

A Render Pass that stores attributes for later deferred shading. More...

#include <attributepass.h>

Inherits RenderPass.

Public Member Functions

void render () override
 Uses the input data to generate the output. More...
 
void cleanup () override
 Resets the Render Pass to the state after creation but before initialization. More...
 
void addObjectInput (VaoChannel &vaoChannel)
 Adds a model to the geometry input list. More...
 
void removeObjectInput (VaoChannel &vaoChannel)
 Removes a model from the geometry input list. More...
 
void clearObjectInput ()
 Removes all models from the geometry input list.
 
void setDepthMapInput (TextureChannel &textureChannel)
 Sets the depth map that shall be used during rendering. More...
 
TextureChannelgetNormalMapOutput ()
 Returns the normal map. More...
 
bool normalMapToScreen ()
 Changes the output mode. The normal map is now drawn onto the screen. More...
 
TextureChannelgetColorMapOutput ()
 Returns the color map. More...
 
bool colorMapToScreen ()
 Changes the output mode. The color map is now drawn onto the screen. More...
 
void removeInput () override
 Removes all input channels except for VaoChannels. If the Render Pass uses VaoChannels as input use the provided clearObjectInput() function to remove all VaoChannels.
 
void updateResolution () override
 Must be called after the screen resolution has changed. More...
 
void linkSplatScale (float &scale)
 Links the splat scale. More...
 
- Public Member Functions inherited from RenderPass
virtual ~RenderPass ()
 Calls cleanup() More...
 

Static Public Member Functions

static void linkVpMat (QMatrix4x4 &vp)
 Links the view projection matrix that shall be used during rendering. More...
 
static void linkVMat (QMatrix4x4 &v)
 Links the view matrix that shall be used during rendering. More...
 
static void linkPointSizeCoeff (float &coeff)
 Links the point size coefficient. More...
 
- Static Public Member Functions inherited from RenderPass
static void cleanupHelpers ()
 Removes helper variables. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RenderPass
template<class C >
bool helperMultiChannelContains (std::list< C * > &list, C &channel)
 
template<class C >
void helperMultiChannelAdd (std::list< C * > &list, C &channel)
 
template<class C >
bool helperMultiChannelRemove (std::list< C * > &list, C &channel)
 
template<class C >
void helperMultiChannelClean (std::list< C * > &list)
 
template<class C >
void helperMultiChannelClear (std::list< C * > &list)
 
- Static Protected Member Functions inherited from RenderPass
static bool loadShader (std::string &path, GLuint id)
 
static bool noGlErrors ()
 
static bool checkFbo ()
 
static void drawUnitQuad ()
 

Detailed Description

A Render Pass that stores attributes for later deferred shading.

This Render Pass takes a depth map and the geometry as input. It creates a color map and a normal map. The geometry's colors and normals are used. Using the given depth map, all visible geometry's attributes are summed and stored into the output. A normalization using the alpha values has to be done before using the stored color and normal values.

Member Function Documentation

void AttributePass::addObjectInput ( VaoChannel &  vaoChannel)

Adds a model to the geometry input list.

Parameters
vaoChannelThe channel containing the geometry.
void AttributePass::cleanup ( )
overridevirtual

Resets the Render Pass to the state after creation but before initialization.

Might use OpenGL calls. If no other instances of this Render Pass are currently initialized the shader program is removed from the GPU.

Implements RenderPass.

bool AttributePass::colorMapToScreen ( )

Changes the output mode. The color map is now drawn onto the screen.

Might use OpenGL calls. Unlike in other Render Passes, the output channels remain active. Further computations on these channels have to be prevented manually if not needed (call removeInput on Render Passes that used the output channels).

Returns
Returns false if the output to the screen could not be set up properly.
RenderPass::TextureChannel & AttributePass::getColorMapOutput ( )

Returns the color map.

Might use OpenGL calls.

Returns
A channel containing the generated color map.
RenderPass::TextureChannel & AttributePass::getNormalMapOutput ( )

Returns the normal map.

Might use OpenGL calls.

Returns
A channel containing the generated normal map.
void AttributePass::linkPointSizeCoeff ( float &  coeff)
static

Links the point size coefficient.

This value can be generated by the Camera. Does not copy the value. The responsibility for deletion remains at the caller.

Parameters
coeffThe coefficient. Must point to a valid float whenever render() is called.
void AttributePass::linkSplatScale ( float &  scale)

Links the splat scale.

The higher the value the bigger the drawn splats. Should be the same as the value used for generating the depth map. A value of 1 leads to no splat scaling. Does not copy the value. The responisbility for deletion remains at the caller.

Parameters
scaleThe scaling coefficient. Must poit to a valid float whenever render() is called.
void AttributePass::linkVMat ( QMatrix4x4 &  v)
static

Links the view matrix that shall be used during rendering.

Does not copy the matrix. The responsibility for deletion remains at the caller.

Parameters
vThe view matrix. Must point to a valid matrix whenever render() is called.
void AttributePass::linkVpMat ( QMatrix4x4 &  vp)
static

Links the view projection matrix that shall be used during rendering.

Does not copy the matrix. The responsibility for deletion remains at the caller.

Parameters
vpThe view projection matrix. Must point to a valid matrix whenever render() is called.
bool AttributePass::normalMapToScreen ( )

Changes the output mode. The normal map is now drawn onto the screen.

Might use OpenGL calls. Unlike in other Render Passes, the output channels remain active. Further computations on these channels have to be prevented manually if not needed (call removeInput on Render Passes that used the output channels).

Returns
Returns false if the output to the screen could not be set up properly.
void AttributePass::removeObjectInput ( VaoChannel &  vaoChannel)

Removes a model from the geometry input list.

Parameters
vaoChannelThe channel containing the geometry that shall not be rendered anymore.
void AttributePass::render ( )
overridevirtual

Uses the input data to generate the output.

Uses OpenGL calls if initialized.

Implements RenderPass.

void AttributePass::setDepthMapInput ( RenderPass::TextureChannel textureChannel)

Sets the depth map that shall be used during rendering.

Uses OpenGL calls.

Parameters
textureChannelThe channel containing the depth map.
void AttributePass::updateResolution ( )
overridevirtual

Must be called after the screen resolution has changed.

Might use OpenGL calls.

Implements RenderPass.


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