27#ifndef EASY3D_RENDERER_DUAL_DEPTH_PEELING_H
28#define EASY3D_RENDERER_DUAL_DEPTH_PEELING_H
31#include <easy3d/renderer/transparency.h>
110 void draw(
const std::vector<TrianglesDrawable*>& surfaces)
override;
115 void init(
int w,
int h);
118 void init_depth_buffers(
const std::vector<TrianglesDrawable*>& surfaces);
121 void geometry_pass(
const std::vector<TrianglesDrawable*>& surfaces);
124 void peel(
const std::vector<TrianglesDrawable*>& surfaces);
127 void blend_final_image();
133 bool peeling_done()
const;
136 void init_occlusion_query();
138 void delete_occlusion_query_id();
141 void start_occlusion_query()
const;
143 void end_occlusion_query();
159 enum DualDepthPeelingStage {
165 DualDepthPeelingStage stage_;
167 FramebufferObject* fbo_;
178 TextureName front_source_;
179 TextureName front_destination_;
180 TextureName depth_source_;
181 TextureName depth_destination_;
184 int num_geom_passes_;
186 bool use_occlusion_query_;
187 unsigned int occlusion_query_Id_;
188 unsigned int num_written_pixels_;
189 unsigned int occlusion_threshold_;
A perspective or orthographic camera.
Definition camera.h:113
int max_peels() const
Returns the maximum number of peeling layers.
Definition dual_depth_peeling.h:104
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() override
Destructor.
Definition dual_depth_peeling.cpp:69
DualDepthPeeling(Camera *cam)
Constructor.
Definition dual_depth_peeling.cpp:48
An implementation of framebuffer object (FBO).
Definition framebuffer_object.h:122
Transparency()=default
Default constructor for Transparency.
The drawable for rendering a set of triangles, e.g., the surface of a triangular mesh.
Definition drawable_triangles.h:46
Definition collider.cpp:182