3 #include "surface_renderer.h"
5 #include "gl/lib_begin.h"
9 class CGV_API surfel_renderer;
15 extern CGV_API surfel_renderer&
ref_surfel_renderer(context& ctx,
int ref_count_change = 0);
32 float blend_width_in_pixel;
55 bool has_group_point_sizes;
56 bool has_indexed_colors;
57 float reference_point_size;
71 void set_reference_point_size(
float _reference_point_size);
73 void set_y_view_angle(
float y_view_angle);
75 template <
typename T =
float>
76 void set_point_size_array(
const context& ctx,
const std::vector<T>& point_sizes) { has_point_sizes =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"point_size"), point_sizes); }
78 template <
typename T =
unsigned,
typename C = cgv::media::color<
float, cgv::media::RGB, cgv::media::OPACITY> >
79 void set_indexed_color_array(
const context& ctx,
const std::vector<T>& color_indices,
const std::vector<C>& palette) {
80 has_indexed_colors =
true;
81 set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"color_index"), color_indices);
82 ref_prog().set_uniform_array(ctx,
"palette", palette);
85 template <
typename T =
unsigned,
typename C = cgv::media::color<
float, cgv::media::RGB, cgv::media::OPACITY> >
86 void set_indexed_color_array(
const context& ctx, T* color_index_ptr,
size_t nr_elements,
const std::vector<C>& palette,
unsigned stride = 0) {
87 has_indexed_colors =
true;
88 set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"color_index"), color_index_ptr, nr_elements, stride);
89 ref_prog().set_uniform_array(ctx,
"palette", palette);
92 template <
typename T =
float>
93 void set_group_point_sizes(
const context& ctx,
const std::vector<T>& group_point_sizes) { has_group_point_sizes =
true; ref_prog().set_uniform_array(ctx,
"group_point_sizes", group_point_sizes); }
95 bool validate_attributes(
const context& ctx)
const;
101 void draw(
context& ctx,
size_t start,
size_t count,
102 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1);
112 #include <cgv/config/lib_end.h>
base class for all render styles
Definition: renderer.h:16
surfel_renderer & ref_surfel_renderer(context &ctx, int ref_count_change)
reference to a singleton surfel renderer that can be shared among drawables
Definition: surfel_renderer.cxx:7
bool orient_splats
set to true in constructor
Definition: surfel_renderer.h:43
float halo_color_strength
strength in [0,1] of halo color with respect to color of primitive
Definition: surfel_renderer.h:41
Definition: surface_renderer.h:26
bool measure_point_size_in_pixel
whether to measure point size in pixels or in world space relative to reference_pixel_size passed to ...
Definition: surfel_renderer.h:27
float percentual_halo_width
set to 0 in constructor
Definition: surfel_renderer.h:37
rgba halo_color
color of halo with opacity channel
Definition: surfel_renderer.h:39
attribute array manager used to upload arrays to gpu
Definition: renderer.h:21
bool use_group_point_size
whether to use the
Definition: surfel_renderer.h:25
Definition: reflection_handler.h:63
Definition: surfel_renderer.h:19
bool blend_points
set to false in constructor
Definition: surfel_renderer.h:45
renderer that supports point splatting
Definition: surfel_renderer.h:52
base classes for renderers that support surface rendering
Definition: surface_renderer.h:43
this reflection traits implementation is used for external self_reflect implementations of instances ...
Definition: reflect_extern.h:28
the cgv namespace
Definition: vr_calib.cxx:9
float halo_width_in_pixel
set to 0 in constructor
Definition: surfel_renderer.h:35
Definition: context.h:525