3#include "surface_renderer.h"
5#include "gl/lib_begin.h"
58 bool has_point_sizes =
false;
59 bool has_group_point_sizes =
false;
60 bool has_indexed_colors =
false;
61 float reference_point_size = 0.01f;
62 float y_view_angle = 45.0f;
73 void set_reference_point_size(
float _reference_point_size);
75 void set_y_view_angle(
float y_view_angle);
77 template <
typename T =
float>
78 void set_point_size_array(
const context& ctx,
const std::vector<T>& point_sizes) { has_point_sizes =
true; set_attribute_array(ctx,
"point_size", point_sizes); }
80 void remove_point_size_array(
const context& ctx);
82 template <
typename T =
unsigned,
typename C = cgv::media::color<
float, cgv::media::RGB, cgv::media::OPACITY> >
83 void set_indexed_color_array(
const context& ctx,
const std::vector<T>& color_indices,
const std::vector<C>& palette) {
84 has_indexed_colors =
true;
85 set_attribute_array(ctx,
"color_index", color_indices);
86 ref_prog().set_uniform_array(ctx,
"palette", palette);
89 template <
typename T =
unsigned,
typename C = cgv::media::color<
float, cgv::media::RGB, cgv::media::OPACITY> >
90 void set_indexed_color_array(
const context& ctx, T* color_index_ptr,
size_t nr_elements,
const std::vector<C>& palette,
unsigned stride = 0) {
91 has_indexed_colors =
true;
92 set_attribute_array(ctx,
"color_index", color_index_ptr, nr_elements, stride);
93 ref_prog().set_uniform_array(ctx,
"palette", palette);
96 void remove_indexed_color_array(
const context& ctx);
98 template <
typename T =
float>
99 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); }
101 bool validate_attributes(
const context& ctx)
const override;
103 bool enable(context& ctx)
override;
105 bool disable(context& ctx)
override;
107 void draw(context& ctx,
size_t start,
size_t count,
108 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
118#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
attribute array manager used to upload arrays to gpu
base class for all drawables, which is independent of the used rendering API.
base classes for renderers that support surface rendering
renderer that supports point splatting
render_style * create_render_style() const override
create and return the default render style
std::string get_default_prog_name() const override
return the default shader program name
namespace for api independent GPU programming
surfel_renderer & ref_surfel_renderer(context &ctx, int ref_count_change)
reference to a singleton surfel renderer that can be shared among drawables
this header is dependency free
cgv::media::color< float, cgv::media::RGB, cgv::media::OPACITY > rgba
declare rgba color type with 32 bit components
this reflection traits implementation is used for external self_reflect implementations of instances ...
base class for all render styles
float percentual_halo_width
set to 0 in constructor
float point_size
default value assigned to point size attribute in enable method of point renderer,...
bool measure_point_size_in_pixel
whether to measure point size in pixels or in world space relative to reference_pixel_size passed to ...
float surface_offset
position offset in normal direction to prevent z-figthing if surfels are placed directly on flat surf...
bool use_group_point_size
whether to use the
bool orient_splats
set to true in constructor
float halo_width_in_pixel
set to 0 in constructor
float blend_width_in_pixel
set to 1 in constructor
bool blend_points
set to false in constructor
rgba halo_color
color of halo with opacity channel
float halo_color_strength
strength in [0,1] of halo color with respect to color of primitive