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

A Render Pass that performs deferred shading. More...

#include <shadingpass.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 setDepthMapInput (TextureChannel &textureChannel)
 Sets the depth map that shall be used during rendering. More...
 
void setColorMapInput (TextureChannel &textureChannel)
 Sets the color map that shall be used during rendering. More...
 
void setNormalMapInput (TextureChannel &textureChannel)
 Sets the normal map that shall be used during rendering. More...
 
TextureChannelgetShadedOutput ()
 Returns the shaded image. More...
 
bool shadedImageToScreen ()
 Changes the output mode. The shaded image 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...
 
- Public Member Functions inherited from RenderPass
virtual ~RenderPass ()
 Calls cleanup() More...
 

Static Public Member Functions

static void linkVMat (QMatrix4x4 &v)
 Links the view matrix that shall be used during rendering. More...
 
static void linkInvProjMat (QMatrix4x4 &ip)
 Links the inverse projection matrix that shall be used during rendering. 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 performs deferred shading.

This Render Pass takes a color map and a normal map as input. It creates a shaded image of the scene. Both maps are normalized using the alpha values. Afterwards phong shading with point lights is performed.

Member Function Documentation

void ShadingPass::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.

RenderPass::TextureChannel & ShadingPass::getShadedOutput ( )

Returns the shaded image.

Might use OpenGL calls.

Returns
A channel containing the rendered image.
void ShadingPass::linkInvProjMat ( QMatrix4x4 &  ip)
static

Links the inverse projection 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 ShadingPass::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 ShadingPass::render ( )
overridevirtual

Uses the input data to generate the output.

Uses OpenGL calls if initialized.

Implements RenderPass.

void ShadingPass::setColorMapInput ( RenderPass::TextureChannel textureChannel)

Sets the color map that shall be used during rendering.

Parameters
textureChannelThe channel containing the color map.
void ShadingPass::setDepthMapInput ( RenderPass::TextureChannel textureChannel)

Sets the depth map that shall be used during rendering.

Parameters
textureChannelThe channel containing the depth map.
void ShadingPass::setNormalMapInput ( RenderPass::TextureChannel textureChannel)

Sets the normal map that shall be used during rendering.

Parameters
textureChannelThe channel containing the normal map.
bool ShadingPass::shadedImageToScreen ( )

Changes the output mode. The shaded image is now drawn onto the screen.

Might use OpenGL calls.

Returns
Returns false if the output to the screen could not be set up properly.
void ShadingPass::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: