Easy3D 2.6.1
|
Transparency effect using dual depth peeling. More...
#include <easy3d/renderer/dual_depth_peeling.h>
Public Member Functions | |
DualDepthPeeling (Camera *cam) | |
Constructor. | |
~DualDepthPeeling () override | |
Destructor. | |
void | set_max_peels (int n) |
Sets the maximum number of peeling layers. | |
int | max_peels () const |
Returns the maximum number of peeling layers. | |
void | draw (const std::vector< TrianglesDrawable * > &surfaces) override |
Renders the scene (a set of surfaces) with transparency effect. | |
![]() | |
Transparency ()=default | |
Default constructor for Transparency. | |
virtual | ~Transparency ()=default |
Virtual destructor for Transparency. | |
Transparency effect using dual depth peeling.
DualDepthPeeling implements the dual depth peeling algorithm described in [Order independent transparency with dual depth peeling] (http://developer.download.nvidia.com/SDK/10.5/opengl/src/dual_depth_peeling/doc/DualDepthPeeling.pdf) by L. Bavoil, K. Myers. February 2008.
Depth peeling is traditionally used to perform order independent transparency (OIT) with N geometry passes for N transparency layers. Dual depth peeling enables peeling N transparency layers in N/2+1 passes, by peeling from the front and the back simultaneously using a min-max depth buffer. It performs peeling and blends on the fly. The pass occurs in several stages:
Related articles or methods:
About antialiasing: Dual depth peeling won't work with a multisample FBO, so for better rendering quality, it is possible to add a "Fast Approximate Anti-Aliasing" (FXAA) step for post antialiasing.
Optimization tips: rendering with multi-effects (e.g., shadowing, SSAO) can benefit from sharing the same geometry pass.
|
explicit |
Constructor.
cam | The camera used in the view |
|
overridevirtual |
Renders the scene (a set of surfaces) with transparency effect.
surfaces | The surfaces to be rendered |
Implements Transparency.
|
inline |
Returns the maximum number of peeling layers.
|
inline |
Sets the maximum number of peeling layers.
It has to be a positive value. Default value is 4. A special value of 0 means no maximum limit.
n | The maximum number of peeling layers |