cgv
|
a shader program combines several shader code fragments to a complete definition of the shading pipeline. More...
#include <shader_program.h>
Public Member Functions | |
shader_program (bool _show_code_errors=false) | |
create empty shader program and set the option whether errors during shader code attachment should be printed to std::cerr | |
~shader_program () | |
call destruct method | |
bool | create (const context &ctx) |
create the shader program | |
void | destruct (const context &ctx) |
destruct shader program | |
bool | attach_code (const context &ctx, const shader_code &code) |
attach a compiled shader code instance that is managed outside of program | |
bool | detach_code (const context &ctx, const shader_code &code) |
detach a shader code | |
bool | attach_code (const context &ctx, const std::string &source, ShaderType st) |
attach a shader code given as string and managed the created shader code object | |
bool | attach_file (const context &ctx, const std::string &file_name, ShaderType st=ST_DETECT, const shader_define_map &defines=shader_define_map()) |
read shader code from file, compile and attach to program | |
bool | attach_files (const context &ctx, const std::string &base_name, const shader_define_map &defines=shader_define_map()) |
read shader code from files with the given base name, compile and attach them | |
bool | attach_dir (const context &ctx, const std::string &dir_name, bool recursive) |
collect shader code files from directory, compile and attach. | |
bool | attach_program (const context &ctx, std::string file_name, bool show_error=false, const shader_define_map &defines=shader_define_map()) |
collect shader code files declared in shader program file, compile and attach them | |
bool | link (const context &ctx, bool show_error=false) |
link shaders to an executable program | |
bool | is_linked () const |
return whether program is linked | |
bool | build_files (const context &ctx, const std::string &base_name, bool show_error=false, const shader_define_map &defines=shader_define_map()) |
successively calls create, attach_files and link. | |
bool | build_dir (const context &ctx, const std::string &dir_name, bool recursive=false, bool show_error=false) |
successively calls create, attach_dir and link. | |
bool | build_program (const context &ctx, const std::string &file_name, bool show_error=false, const shader_define_map &defines=shader_define_map()) |
successively calls create, attach_program and link. | |
void | set_geometry_shader_info (PrimitiveType input_type, PrimitiveType output_type, int max_output_count=0) |
configure the geometry shader, if count < 1 set it to get_max_nr_geometry_shader_output_vertices | |
bool | enable (context &ctx) |
enable the shader program | |
bool | disable (context &ctx) |
disable shader program and restore fixed functionality | |
bool | is_enabled () const |
check whether program is currently enabled | |
int | get_uniform_location (const context &ctx, const std::string &name) const |
query location index of an uniform | |
bool | set_material_uniform (const context &ctx, const std::string &name, const cgv::media::illum::surface_material &material, bool generate_error=false) |
set a uniform of type material | |
bool | set_textured_material_uniform (const context &ctx, const std::string &name, const textured_material &material, bool generate_error=false) |
set a uniform of type textured_material | |
bool | set_light_uniform (const context &ctx, const std::string &name, const cgv::media::illum::light_source &light, bool generate_error=false) |
set a uniform of type light source | |
template<typename T > | |
bool | set_uniform (const context &ctx, const std::string &name, const T &value, bool generate_error=false) |
Set the value of a uniform by name, where the type can be any of int, unsigned, float, vec<int>, vec<unsigned>, vec<float>, mat<float> and the vectors are of dimension 2, 3 or 4 and the matrices of dimensions 2, 3 or 4. | |
template<typename T > | |
bool | set_uniform_array (const context &ctx, const std::string &name, const T &array) |
set uniform array from array array where number elements can be derived from array through array_descriptor_traits ; supported array types include cgv::math::vec and std::vector | |
template<typename T > | |
bool | set_uniform_array (const context &ctx, const std::string &name, const T *array, size_t nr_elements, bool generate_error=false) |
set uniform array from an array with nr_elements elements of type T pointed to by array | |
template<typename T > | |
bool | set_uniform (const context &ctx, int loc, const T &value) |
Set the value of a uniform by name, where the type can be any of int, unsigned, float, vec<int>, vec<unsigned>, vec<float>, mat<float> and the vectors are of dimension 2, 3 or 4 and the matrices of dimensions 2, 3 or 4. | |
template<typename T > | |
bool | set_uniform_array (const context &ctx, int loc, const T &array) |
set uniform array from array array where number elements can be derived from array through array_descriptor_traits ; supported array types include cgv::math::vec and std::vector | |
template<typename T > | |
bool | set_uniform_array (const context &ctx, int loc, const T *array, size_t nr_elements) |
set uniform array from an array with nr_elements elements of type T pointed to by array | |
int | get_attribute_location (const context &ctx, const std::string &name) const |
query location index of an attribute | |
template<typename T > | |
bool | set_attribute (const context &ctx, const std::string &name, const T &value) |
set constant default value of a vertex attribute by attribute name, if name does not specify an attribute, an error message is generated | |
template<typename T > | |
bool | set_attribute (const context &ctx, int loc, const T &value) |
set constant default value of a vertex attribute by location index | |
![]() | |
shader_program_base () | |
initializes members | |
void | specify_standard_uniforms (bool view, bool material, bool lights, bool gamma) |
void | specify_standard_vertex_attribute_names (context &ctx, bool color=true, bool normal=true, bool texcoord=true) |
void | specify_vertex_attribute_names (context &ctx, const std::string &position, const std::string &color="", const std::string &normal="", const std::string &texcoord="") |
bool | does_use_view () const |
bool | does_use_material () const |
bool | does_use_lights () const |
bool | does_use_gamma () const |
void | allow_context_to_set_color (bool allow) |
int | get_position_index () const |
int | get_color_index () const |
bool | does_context_set_color () const |
int | get_normal_index () const |
int | get_texcoord_index () const |
![]() | |
render_component () | |
initialize members | |
virtual bool | is_created () const |
return whether component has been created | |
void | put_id_void (void *ptr) const |
copy the rendering api specific id the component to the memory location of the given pointer. | |
template<typename T > | |
void | put_id (T &id) const |
cast the refence to rendering api specific representation of component id to the specified type | |
Static Public Member Functions | |
static bool | collect_files_from_cache (const std::string &name, std::vector< std::string > &file_names, bool &added_files) |
resolve file name with shader_code::find_file and add file to list if found | |
static bool | collect_file (const std::string &file_name, bool use_cache, std::vector< std::string > &file_names) |
resolve file name with shader_code::find_file and add file to list if found | |
static bool | collect_files (const std::string &base_name, bool use_cache, std::vector< std::string > &file_names) |
collect shader code files that extent the given base name. | |
static bool | collect_dir (const std::string &dir_name, bool recursive, std::vector< std::string > &file_names) |
collect shader code files from directory. | |
static bool | collect_program (const std::string &file_name, bool use_cache, std::vector< std::string > &file_names) |
collect shader code files declared in a shader program file. | |
static unsigned int | get_max_nr_geometry_shader_output_vertices (const context &ctx) |
return the maximum number of output vertices of a geometry shader | |
static std::vector< shader_define_map > | extract_instances (std::string file_name) |
find and parse all instance definitions in a shader program file | |
Protected Member Functions | |
bool | attach_files (const context &ctx, const std::vector< std::string > &file_names, const shader_define_map &defines=shader_define_map()) |
attach a list of files | |
void | update_state (const context &ctx) |
ensure that the state has been set in the context | |
Static Protected Member Functions | |
static bool | open_program_file (std::string &file_name, bool use_cache, std::string &content, std::vector< cgv::utils::line > &lines, std::string *last_error_ptr=0) |
common code necessary to open file | |
Protected Attributes | |
bool | show_code_errors: 1 |
bool | linked: 1 |
bool | state_out_of_date: 1 |
int | nr_attached_geometry_shaders: 13 |
std::vector< shader_code * > | managed_codes |
![]() | |
bool | is_enabled |
bool | auto_detect_uniforms |
bool | auto_detect_vertex_attributes |
bool | uses_view |
bool | uses_material |
bool | uses_lights |
bool | uses_gamma |
int | position_index |
int | color_index |
bool | context_sets_color |
int | normal_index |
int | texcoord_index |
Static Protected Attributes | |
static std::map< std::string, std::string > | program_file_cache |
maps used to cache program file contents and valid file names indexed by their respective file name | |
static std::map< std::string, std::vector< std::string > > | files_cache |
Additional Inherited Members | |
![]() | |
PrimitiveType | geometry_shader_input_type |
PrimitiveType | geometry_shader_output_type |
int | geometry_shader_output_count |
![]() | |
void * | handle |
void * | internal_format |
void * | user_data |
const context * | ctx_ptr |
keep pointer to my context | |
std::string | last_error |
a string that contains the last error | |
a shader program combines several shader code fragments to a complete definition of the shading pipeline.
Definition at line 27 of file shader_program.h.
cgv::render::shader_program::shader_program | ( | bool | _show_code_errors = false | ) |
create empty shader program and set the option whether errors during shader code attachment should be printed to std::cerr
create empty shader program
Definition at line 176 of file shader_program.cxx.
cgv::render::shader_program::~shader_program | ( | ) |
call destruct method
Definition at line 185 of file shader_program.cxx.
References cgv::render::render_component::ctx_ptr, destruct(), and cgv::render::context::make_current().
bool cgv::render::shader_program::attach_code | ( | const context & | ctx, |
const shader_code & | code | ||
) |
attach a compiled shader code instance that is managed outside of program
Definition at line 209 of file shader_program.cxx.
References cgv::render::shader_code::get_shader_type(), cgv::render::shader_code::is_compiled(), and cgv::render::render_component::last_error.
Referenced by attach_code(), attach_file(), and cgv::render::gl::complete_program_form_render_to_texture3D().
bool cgv::render::shader_program::attach_code | ( | const context & | ctx, |
const std::string & | source, | ||
ShaderType | st | ||
) |
attach a shader code given as string and managed the created shader code object
Definition at line 247 of file shader_program.cxx.
References attach_code(), cgv::render::shader_code::compile(), cgv::render::render_component::last_error, and cgv::render::shader_code::set_code().
bool cgv::render::shader_program::attach_dir | ( | const context & | ctx, |
const std::string & | dir_name, | ||
bool | recursive | ||
) |
collect shader code files from directory, compile and attach.
Definition at line 279 of file shader_program.cxx.
References attach_files(), and collect_dir().
Referenced by attach_program(), and build_dir().
bool cgv::render::shader_program::attach_file | ( | const context & | ctx, |
const std::string & | file_name, | ||
ShaderType | st = ST_DETECT , |
||
const shader_define_map & | defines = shader_define_map() |
||
) |
read shader code from file, compile and attach to program
Definition at line 260 of file shader_program.cxx.
References attach_code(), cgv::render::render_component::last_error, and cgv::render::shader_code::read_and_compile().
Referenced by attach_files(), and attach_program().
bool cgv::render::shader_program::attach_files | ( | const context & | ctx, |
const std::string & | base_name, | ||
const shader_define_map & | defines = shader_define_map() |
||
) |
read shader code from files with the given base name, compile and attach them
Definition at line 272 of file shader_program.cxx.
References attach_files(), collect_files(), and cgv::render::context::is_shader_file_cache_enabled().
|
protected |
attach a list of files
Definition at line 19 of file shader_program.cxx.
References attach_file(), and cgv::render::render_component::last_error.
Referenced by attach_dir(), attach_files(), attach_program(), and build_files().
bool cgv::render::shader_program::attach_program | ( | const context & | ctx, |
std::string | file_name, | ||
bool | show_error = false , |
||
const shader_define_map & | defines = shader_define_map() |
||
) |
collect shader code files declared in shader program file, compile and attach them
Definition at line 357 of file shader_program.cxx.
References attach_dir(), attach_file(), attach_files(), attach_program(), cgv::utils::token::begin, cgv::render::get_shader_config(), cgv::utils::is_integer(), cgv::render::context::is_shader_file_cache_enabled(), cgv::utils::is_space(), cgv::render::render_component::last_error, open_program_file(), set_geometry_shader_info(), cgv::utils::tokenizer::set_ws(), and cgv::utils::to_string().
Referenced by attach_program(), and build_program().
bool cgv::render::shader_program::build_dir | ( | const context & | ctx, |
const std::string & | dir_name, | ||
bool | recursive = false , |
||
bool | show_error = false |
||
) |
successively calls create, attach_dir and link.
Definition at line 477 of file shader_program.cxx.
References attach_dir(), create(), cgv::render::render_component::is_created(), and link().
bool cgv::render::shader_program::build_files | ( | const context & | ctx, |
const std::string & | base_name, | ||
bool | show_error = false , |
||
const shader_define_map & | defines = shader_define_map() |
||
) |
successively calls create, attach_files and link.
Definition at line 471 of file shader_program.cxx.
References attach_files(), create(), cgv::render::render_component::is_created(), and link().
Referenced by cgv::render::a_buffer::init().
bool cgv::render::shader_program::build_program | ( | const context & | ctx, |
const std::string & | file_name, | ||
bool | show_error = false , |
||
const shader_define_map & | defines = shader_define_map() |
||
) |
successively calls create, attach_program and link.
Definition at line 484 of file shader_program.cxx.
References attach_program(), create(), cgv::render::shader_code::find_file(), cgv::render::render_component::is_created(), cgv::render::render_component::last_error, link(), cgv::utils::split_to_lines(), and cgv::utils::to_string().
Referenced by cgv::render::arrow_renderer::build_shader_program(), cgv::render::box_renderer::build_shader_program(), cgv::render::box_wire_renderer::build_shader_program(), cgv::render::cone_renderer::build_shader_program(), cgv::render::ellipsoid_renderer::build_shader_program(), cgv::render::line_renderer::build_shader_program(), cgv::render::normal_renderer::build_shader_program(), cgv::render::point_renderer::build_shader_program(), cgv::render::rectangle_renderer::build_shader_program(), cgv::render::slab_renderer::build_shader_program(), cgv::render::sphere_renderer::build_shader_program(), cgv::render::spline_tube_renderer::build_shader_program(), cgv::render::surfel_renderer::build_shader_program(), cgv::render::volume_renderer::build_shader_program(), cgv::plot::plot2d::init(), cgv::plot::plot3d::init(), cgv::plot::plot_base::init(), cgv::render::gl::image_drawable::init(), cgv::render::a_buffer::init(), vr_test::init_frame(), and cgv::render::a_buffer::init_frame().
|
static |
collect shader code files from directory.
If the directory does not exist search it in the shader path of the shader configuration returned by get_shader_config(). Returns true if at least one shader code file has been collected.
Definition at line 106 of file shader_program.cxx.
References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::render::get_shader_config().
Referenced by attach_dir(), and collect_program().
|
static |
resolve file name with shader_code::find_file and add file to list if found
Definition at line 46 of file shader_program.cxx.
References collect_files_from_cache(), and cgv::render::shader_code::find_file().
Referenced by collect_program().
|
static |
collect shader code files that extent the given base name.
Returns true if at least one shader code file has been collected.
Definition at line 72 of file shader_program.cxx.
References collect_files_from_cache(), and cgv::render::shader_code::find_file().
Referenced by attach_files(), and collect_program().
|
static |
resolve file name with shader_code::find_file and add file to list if found
Definition at line 30 of file shader_program.cxx.
Referenced by collect_file(), and collect_files().
|
static |
collect shader code files declared in a shader program file.
Program files have the extension glpr and contain lines of the form command:argument. The following commands can be used
Definition at line 128 of file shader_program.cxx.
References collect_dir(), collect_file(), collect_files(), collect_program(), cgv::render::shader_code::decode_if_base64(), cgv::render::shader_code::find_file(), cgv::render::get_shader_config(), cgv::base::read_data_file(), cgv::utils::split_to_lines(), and cgv::utils::to_string().
Referenced by collect_program().
bool cgv::render::shader_program::create | ( | const context & | ctx | ) |
create the shader program
Definition at line 195 of file shader_program.cxx.
References cgv::render::render_component::ctx_ptr, and destruct().
Referenced by build_dir(), build_files(), and build_program().
void cgv::render::shader_program::destruct | ( | const context & | ctx | ) |
destruct shader program
Definition at line 670 of file shader_program.cxx.
Referenced by cgv::plot::plot3d::clear(), cgv::plot::plot_base::clear(), cgv::render::gl::image_drawable::clear(), create(), cgv::render::a_buffer::destruct(), cgv::render::renderer::enable(), cgv::render::a_buffer::init_frame(), and ~shader_program().
bool cgv::render::shader_program::detach_code | ( | const context & | ctx, |
const shader_code & | code | ||
) |
detach a shader code
Definition at line 230 of file shader_program.cxx.
References cgv::render::shader_code::get_shader_type(), and cgv::render::render_component::last_error.
bool cgv::render::shader_program::disable | ( | context & | ctx | ) |
disable shader program and restore fixed functionality
Definition at line 580 of file shader_program.cxx.
References cgv::render::context::error(), and is_enabled().
Referenced by cgv::render::gl::cover_screen(), cgv::render::gl::gl_performance_monitor::draw(), vr_test::draw(), cgv::render::gl::image_drawable::draw(), cgv::render::render_info::draw(), cgv::render::clod_point_renderer::draw_points(), vr_test::finish_draw(), cgv::render::a_buffer::finish_frame(), cgv::render::a_buffer::init_frame(), cgv::render::clod_point_renderer::reduce_buffer_finish(), cgv::render::clod_point_renderer::reduce_chunks(), and cgv::render::clod_point_renderer::reduce_points().
bool cgv::render::shader_program::enable | ( | context & | ctx | ) |
enable the shader program
Definition at line 558 of file shader_program.cxx.
References cgv::render::context::error(), cgv::render::render_component::is_created(), is_enabled(), is_linked(), and update_state().
Referenced by cgv::render::gl::cover_screen(), cgv::render::gl::gl_performance_monitor::draw(), vr_test::draw(), cgv::render::gl::image_drawable::draw(), cgv::render::render_info::draw(), cgv::render::gl::gl_implicit_surface_drawable_base::draw_implicit_surface(), cgv::render::clod_point_renderer::draw_points(), vr_test::finish_draw(), cgv::render::a_buffer::finish_frame(), cgv::render::a_buffer::init_frame(), cgv::render::clod_point_renderer::reduce_buffer_init(), cgv::render::clod_point_renderer::reduce_chunks(), and cgv::render::clod_point_renderer::reduce_points().
|
static |
find and parse all instance definitions in a shader program file
Definition at line 317 of file shader_program.cxx.
References cgv::utils::token::begin, cgv::utils::is_space(), open_program_file(), cgv::utils::split_to_tokens(), and cgv::utils::to_string().
int cgv::render::shader_program::get_attribute_location | ( | const context & | ctx, |
const std::string & | name | ||
) | const |
query location index of an attribute
Definition at line 664 of file shader_program.cxx.
Referenced by cgv::render::render_info::bind(), cgv::render::attribute_array_binding::bind_attribute_array(), cgv::render::rectangle_renderer::enable(), and cgv::plot::plot_base::init().
|
static |
return the maximum number of output vertices of a geometry shader
Definition at line 510 of file shader_program.cxx.
Referenced by update_state().
int cgv::render::shader_program::get_uniform_location | ( | const context & | ctx, |
const std::string & | name | ||
) | const |
query location index of an uniform
Definition at line 592 of file shader_program.cxx.
Referenced by cgv::render::gl::render_to_texture3D(), cgv::render::context::set_current_gamma(), and cgv::plot::plot_base::set_mapping_uniforms().
|
inline |
check whether program is currently enabled
Definition at line 126 of file shader_program.h.
Referenced by cgv::render::gl::cover_screen(), disable(), and enable().
bool cgv::render::shader_program::is_linked | ( | ) | const |
return whether program is linked
Definition at line 543 of file shader_program.cxx.
Referenced by cgv::render::gl::image_drawable::draw(), enable(), and vr_test::init_frame().
bool cgv::render::shader_program::link | ( | const context & | ctx, |
bool | show_error = false |
||
) |
link shaders to an executable program
Definition at line 528 of file shader_program.cxx.
References cgv::render::render_component::last_error, and update_state().
Referenced by build_dir(), build_files(), build_program(), and cgv::render::gl::complete_program_form_render_to_texture3D().
|
staticprotected |
common code necessary to open file
Definition at line 285 of file shader_program.cxx.
References cgv::render::shader_code::decode_if_base64(), cgv::render::shader_code::find_file(), program_file_cache, cgv::base::read_data_file(), and cgv::utils::split_to_lines().
Referenced by attach_program(), and extract_instances().
|
inline |
set constant default value of a vertex attribute by attribute name, if name does not specify an attribute, an error message is generated
Definition at line 188 of file shader_program.h.
References cgv::render::context::error().
Referenced by cgv::render::box_renderer::enable(), cgv::render::box_wire_renderer::enable(), cgv::render::cone_renderer::enable(), cgv::render::ellipsoid_renderer::enable(), cgv::render::line_renderer::enable(), cgv::render::point_renderer::enable(), cgv::render::rectangle_renderer::enable(), cgv::render::sphere_renderer::enable(), cgv::render::spline_tube_renderer::enable(), cgv::render::surfel_renderer::enable(), cgv::render::line_renderer::init(), cgv::render::context::set_color(), cgv::render::gl::gl_context::set_color(), and cgv::render::rectangle_renderer::set_textured_rectangle().
|
inline |
set constant default value of a vertex attribute by location index
Definition at line 198 of file shader_program.h.
References cgv::render::context::error().
void cgv::render::shader_program::set_geometry_shader_info | ( | PrimitiveType | input_type, |
PrimitiveType | output_type, | ||
int | max_output_count = 0 |
||
) |
configure the geometry shader, if count < 1 set it to get_max_nr_geometry_shader_output_vertices
configure the geometry shader
Definition at line 549 of file shader_program.cxx.
Referenced by attach_program().
bool cgv::render::shader_program::set_light_uniform | ( | const context & | ctx, |
const std::string & | name, | ||
const cgv::media::illum::light_source & | light, | ||
bool | generate_error = false |
||
) |
set a uniform of type light source
Definition at line 638 of file shader_program.cxx.
References set_uniform().
Referenced by cgv::render::context::set_current_lights().
bool cgv::render::shader_program::set_material_uniform | ( | const context & | ctx, |
const std::string & | name, | ||
const cgv::media::illum::surface_material & | material, | ||
bool | generate_error = false |
||
) |
set a uniform of type material
Definition at line 597 of file shader_program.cxx.
References set_uniform().
Referenced by cgv::render::context::set_current_material(), cgv::render::context::set_material(), and set_textured_material_uniform().
bool cgv::render::shader_program::set_textured_material_uniform | ( | const context & | ctx, |
const std::string & | name, | ||
const textured_material & | material, | ||
bool | generate_error = false |
||
) |
set a uniform of type textured_material
Definition at line 614 of file shader_program.cxx.
References cgv::media::illum::textured_surface_material::get_nr_image_files(), cgv::media::illum::textured_surface_material::get_sRGBA_textures(), set_material_uniform(), and set_uniform().
Referenced by cgv::render::context::set_textured_material().
|
inline |
Set the value of a uniform by name, where the type can be any of int, unsigned, float, vec<int>, vec<unsigned>, vec<float>, mat<float> and the vectors are of dimension 2, 3 or 4 and the matrices of dimensions 2, 3 or 4.
Definition at line 139 of file shader_program.h.
References cgv::render::context::error().
Referenced by cgv::render::configure_color_scale(), vr::configure_seethrough_shader_program(), vr_test::draw(), cgv::render::gl::image_drawable::draw(), cgv::render::render_info::draw(), cgv::render::arrow_renderer::enable(), cgv::render::box_renderer::enable(), cgv::render::box_wire_renderer::enable(), cgv::render::cone_renderer::enable(), cgv::render::ellipsoid_renderer::enable(), cgv::render::group_renderer::enable(), cgv::render::line_renderer::enable(), cgv::render::normal_renderer::enable(), cgv::render::point_renderer::enable(), cgv::render::rectangle_renderer::enable(), cgv::render::slab_renderer::enable(), cgv::render::sphere_renderer::enable(), cgv::render::spline_tube_renderer::enable(), cgv::render::surfel_renderer::enable(), cgv::render::volume_renderer::enable(), cgv::render::a_buffer::enable(), vr_test::finish_draw(), cgv::render::a_buffer::finish_frame(), cgv::plot::plot3d::init(), cgv::render::a_buffer::init_frame(), cgv::render::clod_point_renderer::reduce_buffer(), cgv::render::clod_point_renderer::reduce_buffer_init(), cgv::render::clod_point_renderer::reduce_chunks(), cgv::render::clod_point_renderer::reduce_points(), cgv::render::gl::gl_context::ref_default_shader_program(), cgv::render::gl::render_to_texture3D(), cgv::render::context::set_current_gamma(), cgv::render::context::set_current_lights(), cgv::render::context::set_current_view(), set_light_uniform(), cgv::render::gl::set_lighting_parameters(), set_material_uniform(), cgv::plot::plot_base::set_plot_uniforms(), and set_textured_material_uniform().
|
inline |
Set the value of a uniform by name, where the type can be any of int, unsigned, float, vec<int>, vec<unsigned>, vec<float>, mat<float> and the vectors are of dimension 2, 3 or 4 and the matrices of dimensions 2, 3 or 4.
Definition at line 171 of file shader_program.h.
|
inline |
set uniform array from array array
where number elements can be derived from array through array_descriptor_traits
; supported array types include cgv::math::vec and std::vector
Definition at line 149 of file shader_program.h.
References cgv::render::context::error().
Referenced by cgv::render::configure_color_scale(), cgv::render::configure_color_scale(), cgv::render::cone_renderer::enable(), cgv::render::gl::set_lighting_parameters(), cgv::plot::plot_base::set_mapping_uniforms(), and cgv::plot::plot_base::set_plot_uniforms().
|
inline |
set uniform array from an array with nr_elements
elements of type T pointed to by array
Definition at line 159 of file shader_program.h.
References cgv::render::context::error().
|
inline |
set uniform array from array array
where number elements can be derived from array through array_descriptor_traits
; supported array types include cgv::math::vec and std::vector
Definition at line 176 of file shader_program.h.
|
inline |
set uniform array from an array with nr_elements
elements of type T pointed to by array
Definition at line 181 of file shader_program.h.
|
protected |
ensure that the state has been set in the context
Definition at line 516 of file shader_program.cxx.
References get_max_nr_geometry_shader_output_vertices().
|
staticprotected |
Definition at line 32 of file shader_program.h.
|
protected |
Definition at line 35 of file shader_program.h.
|
protected |
Definition at line 39 of file shader_program.h.
|
protected |
Definition at line 37 of file shader_program.h.
|
staticprotected |
maps used to cache program file contents and valid file names indexed by their respective file name
Definition at line 31 of file shader_program.h.
Referenced by open_program_file().
|
protected |
Definition at line 34 of file shader_program.h.
|
protected |
Definition at line 36 of file shader_program.h.