27#ifndef EASY3D_RENDERER_DUAL_DEPTH_PEELING_H
28#define EASY3D_RENDERER_DUAL_DEPTH_PEELING_H
31#include <easy3d/renderer/transparency.h>
85 class TrianglesDrawable;
86 class FramebufferObject;
104 void draw(
const std::vector<TrianglesDrawable*>& surfaces)
override;
110 void init(
int w,
int h);
113 void init_depth_buffers(
const std::vector<TrianglesDrawable*>& surfaces);
116 void geometry_pass(
const std::vector<TrianglesDrawable*>& surfaces);
119 void peel(
const std::vector<TrianglesDrawable*>& surfaces);
121 void blend_final_image();
126 bool peeling_done()
const;
128 void init_occlusion_query();
129 void delete_occlusion_query_id();
131 void start_occlusion_query()
const;
132 void end_occlusion_query();
148 enum DualDepthPeelingStage {
154 DualDepthPeelingStage stage_;
156 FramebufferObject* fbo_;
167 TextureName front_source_;
168 TextureName front_destination_;
169 TextureName depth_source_;
170 TextureName depth_destination_;
173 int num_geom_passes_;
175 bool use_occlusion_query_;
176 unsigned int occlusion_query_Id_;
177 unsigned int num_written_pixels_;
178 unsigned int occlusion_threshold_;
A perspective or orthographic camera.
Definition: camera.h:116
Transparency effect using dual depth peeling.
Definition: dual_depth_peeling.h:89
int max_peels() const
Returns the maximum number of peeling layers.
Definition: dual_depth_peeling.h:101
void draw(const std::vector< TrianglesDrawable * > &surfaces) override
Renders the scene (a set of surfaces) with transparency effect.
Definition: dual_depth_peeling.cpp:313
void set_max_peels(int n)
Sets the maximum number of peeling layers.
Definition: dual_depth_peeling.h:98
DualDepthPeeling(Camera *cam)
Constructor.
Definition: dual_depth_peeling.cpp:48
Base class for rendering with transparency.
Definition: transparency.h:44
Definition: collider.cpp:182