Easy3D 2.6.1
Loading...
Searching...
No Matches
AmbientOcclusion Class Reference

Traditional Screen Space Ambient Occlusion (SSAO) technique. More...

#include <easy3d/renderer/ambient_occlusion.h>

Public Member Functions

 AmbientOcclusion (Camera *cam)
 Constructor.
 
virtual ~AmbientOcclusion ()
 Destructor.
 
void set_radius (float r)
 Sets the sample radius (in pixels). Typical value is in range [0, 4].
 
float radius () const
 Returns the sample radius.
 
void set_bias (float b)
 Sets the bias. Default value is 0.005.
 
float bias () const
 Returns the bias.
 
virtual unsigned int generate (const std::vector< std::shared_ptr< Model > > &models)
 Generates the SSAO texture.
 
unsigned int ssao_texture () const
 Returns the generated SSAO texture ID.
 

Detailed Description

Traditional Screen Space Ambient Occlusion (SSAO) technique.

Optimization tip: rendering with multi-effects (e.g., shadowing, SSAO) can benefit from using a shared geometry pass.

Examples
Tutorial_501_AmbientOcclusion/main.cpp.

Constructor & Destructor Documentation

◆ AmbientOcclusion()

AmbientOcclusion ( Camera * cam)
explicit

Constructor.

Parameters
camThe camera used in the view

Member Function Documentation

◆ bias()

float bias ( ) const
inline

Returns the bias.

Returns
The bias value

◆ generate()

unsigned int generate ( const std::vector< std::shared_ptr< Model > > & models)
virtual

Generates the SSAO texture.

Parameters
modelsThe models to be rendered
Returns
The SSAO texture ID

◆ radius()

float radius ( ) const
inline

Returns the sample radius.

Returns
The sample radius

◆ set_bias()

void set_bias ( float b)
inline

Sets the bias. Default value is 0.005.

Parameters
bThe bias value

◆ set_radius()

void set_radius ( float r)
inline

Sets the sample radius (in pixels). Typical value is in range [0, 4].

Parameters
rThe sample radius

◆ ssao_texture()

unsigned int ssao_texture ( ) const

Returns the generated SSAO texture ID.

Returns
The SSAO texture ID

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