35 GLuint draw_parameters;
37 GLuint max_num_points = 0;
39 GLuint get_vertex_array();
45 void resize(GLuint size);
48 GLuint get_index_buffer();
51 GLuint get_draw_parameters();
54 GLuint get_reduced_points();
56 GLuint num_reduced_points();
106 template <
typename P>
107 Point(
const P& pnt) {
108 p_position = pnt.position();
109 p_color = pnt.
color();
110 p_level = pnt.level();
113 inline vec3& position() {
120 inline rgb8& color() {
123 inline const vec3& position()
const {
127 inline const uint8_t&
level()
const {
130 inline const rgb8& color()
const {
136 shader_program reduce_prog;
137 shader_program* draw_prog_ptr;
138 shader_program draw_prog;
140 clod_point_buffer_manager buffer_manager;
141 clod_point_buffer_manager* active_buffer_manager_ptr;
143 GLuint active_vertex_array = 0;
149 GLuint input_buffer = 0;
151 GLuint active_render_buffer = 0, active_draw_parameter_buffer = 0, active_index_buffer = 0;
153 const int input_pos = 0, render_pos = 1, index_pos = 2,drawp_pos = 3, input_id_pos = 4;
155 GLsizeiptr input_buffer_size = 0;
156 GLuint input_buffer_num_points = 0;
158 bool buffers_outofdate =
true;
160 float frustum_extend = 1.f;
162 vec4 pivot_point_in_view_space;
167 mutable render_style* default_render_style =
nullptr;
169 const render_style* rs =
nullptr;
172 struct uniform_locations {
181 protection_zone_points,
184 int CLODParameterBlock;
188 const render_style* get_style_ptr()
const;
190 template <
typename T>
191 const T& get_style()
const {
return *
static_cast<const T*
>(get_style_ptr()); }
194 clod_point_renderer();
196 render_style* create_render_style()
const;
198 bool init(context& ctx);
201 bool enable(context& ctx);
203 bool enable(context& ctx,
const mat4& reduction_model_view_matrix);
205 bool enable_buffer_manager(clod_point_buffer_manager& manager);
207 void disable_buffer_manager();
209 bool disable(context& ctx);
214 void draw(context& ctx,
size_t start=0,
size_t count=0);
216 bool render(context& ctx,
size_t start,
size_t count);
227 void set_points(
cgv::render::context& ctx,
const vec3* positions,
const rgb8* colors,
const uint8_t* lods,
const size_t num_points,
const unsigned stride = 0);
234 void set_frustum_extend(
const float& fe);
239 void set_pivot_point(
const vec4& pivot);
241 void set_render_style(
const render_style& rs);
243 void manage_singelton(context& ctx,
const std::string& renderer_name,
int& ref_count,
int ref_count_change);
246 void set_prog(shader_program& one_shot_prog);
253 void reduce_buffer_init(context& ctx,
bool reset_parameters =
true);
255 void reduce_buffer(context& ctx,
const GLuint buffer,
const GLuint point_id_buffer,
size_t start,
size_t count);
257 void reduce_buffer_finish(context& ctx);
260 void reduce_points(context& ctx,
size_t start,
size_t count);
265 void reduce_chunks(context& ctx,
const uint32_t* chunk_starts,
const uint32_t* chunk_point_counts,
const uint32_t* reduction_sources, uint32_t num_reduction_sources);
268 void draw_points(context& ctx);
272 unsigned int num_reduced_points();
276 void clear_buffers(context& ctx);
277 static void reset_draw_parameters(context& ctx, GLuint draw_parameter_buffer);
base class for all drawables, which is independent of the used rendering API.