cgv
|
the mesh_render_info structure manages vertex buffer objects for attribute and element buffers as well as an attribute array binding object. More...
#include <render_info.h>
Public Types | |
typedef cgv::type::uint32_type | idx_type |
define index type | |
Public Member Functions | |
render_info () | |
set vbo and vbe types | |
const std::vector< textured_material * > & | get_materials () const |
give read access to materials | |
const std::vector< vertex_buffer * > & | get_vbos () const |
give read access to vbos | |
const std::vector< attribute_array > & | get_aas () const |
give read access to aabs | |
const std::vector< texture * > & | get_textures () const |
give read access to texture | |
const std::vector< draw_call > & | get_draw_calls () const |
give read access to draw calls | |
std::vector< textured_material * > & | ref_materials () |
give write access to materials | |
std::vector< vertex_buffer * > & | ref_vbos () |
give write access to vbos | |
std::vector< attribute_array > & | ref_aas () |
give write access to aabs | |
std::vector< texture * > & | ref_textures () |
give write access to texture | |
std::vector< draw_call > & | ref_draw_calls () |
give write access to draw calls | |
virtual bool | bind (context &ctx, shader_program &prog, bool force_success, int aa_index=-1) |
bind all or specific aa to the passed shader program | |
void | draw_all (context &ctx, bool skip_opaque=false, bool skip_blended=false, bool use_materials=true) |
execute all draw calls | |
void | destruct (cgv::render::context &ctx) |
destruct render mesh info and free vertex buffer objects | |
Protected Member Functions | |
void | draw (context &ctx, const draw_call &dc, const draw_call *prev_dc=0, const draw_call *next_dc=0, bool use_materials=true) |
perform a single render call | |
Protected Attributes | |
std::vector< textured_material * > | materials |
store materials | |
std::vector< texture * > | textures |
store textures | |
std::vector< vertex_buffer * > | vbos |
store buffers | |
std::vector< attribute_array > | aas |
store attribute bindings | |
std::vector< draw_call > | draw_calls |
store vector of render calls | |
the mesh_render_info structure manages vertex buffer objects for attribute and element buffers as well as an attribute array binding object.
The vertex buffer can be constructed from a simple mesh and the attribute array binding is bound to a specific shader program which defines the attribute locations.
Definition at line 75 of file render_info.h.
define index type
Definition at line 79 of file render_info.h.
cgv::render::render_info::render_info | ( | ) |
set vbo and vbe types
Definition at line 111 of file render_info.cxx.
|
virtual |
bind all or specific aa to the passed shader program
bind all or specific draw call to the passed shader program
Reimplemented in cgv::render::mesh_render_info.
Definition at line 175 of file render_info.cxx.
References cgv::render::attribute_array_binding::disable_array(), cgv::render::shader_program::get_attribute_location(), ref_aas(), ref_draw_calls(), ref_vbos(), and cgv::render::attribute_array_binding::set_attribute_array().
Referenced by cgv::render::mesh_render_info::bind(), and cgv::render::mesh_render_info::bind_wireframe().
void cgv::render::render_info::destruct | ( | cgv::render::context & | ctx | ) |
destruct render mesh info and free vertex buffer objects
Definition at line 257 of file render_info.cxx.
References aas, draw_calls, materials, textures, and vbos.
Referenced by cgv::render::build_render_info(), and cgv::render::mesh_render_info::destruct().
|
protected |
perform a single render call
Definition at line 27 of file render_info.cxx.
References aas, cgv::render::shader_program::disable(), cgv::render::shader_program::enable(), cgv::render::context::get_current_material(), cgv::render::context::get_current_program(), materials, cgv::render::context::set_material(), and cgv::render::shader_program::set_uniform().
Referenced by draw_all(), cgv::render::mesh_render_info::draw_primitive(), and cgv::render::mesh_render_info::draw_wireframe().
void cgv::render::render_info::draw_all | ( | context & | ctx, |
bool | skip_opaque = false , |
||
bool | skip_blended = false , |
||
bool | use_materials = true |
||
) |
execute all draw calls
Definition at line 230 of file render_info.cxx.
References draw(), and draw_calls.
Referenced by vr_test::draw(), cgv::render::gl::gl_implicit_surface_drawable_base::draw_implicit_surface(), cgv::render::gl::mesh_drawable::draw_mesh(), and vr_view_interactor::draw_vr_kits().
const std::vector< attribute_array > & cgv::render::render_info::get_aas | ( | ) | const |
const std::vector< draw_call > & cgv::render::render_info::get_draw_calls | ( | ) | const |
give read access to draw calls
Definition at line 140 of file render_info.cxx.
References draw_calls.
const std::vector< textured_material * > & cgv::render::render_info::get_materials | ( | ) | const |
const std::vector< texture * > & cgv::render::render_info::get_textures | ( | ) | const |
const std::vector< vertex_buffer * > & cgv::render::render_info::get_vbos | ( | ) | const |
std::vector< attribute_array > & cgv::render::render_info::ref_aas | ( | ) |
give write access to aabs
Definition at line 158 of file render_info.cxx.
References aas.
Referenced by bind(), cgv::render::build_render_info(), and cgv::render::mesh_render_info::construct_draw_calls().
std::vector< draw_call > & cgv::render::render_info::ref_draw_calls | ( | ) |
give write access to draw calls
Definition at line 169 of file render_info.cxx.
References draw_calls.
Referenced by bind(), cgv::render::build_render_info(), cgv::render::mesh_render_info::construct_draw_calls(), and cgv::render::mesh_render_info::set_nr_instances().
std::vector< textured_material * > & cgv::render::render_info::ref_materials | ( | ) |
give write access to materials
Definition at line 146 of file render_info.cxx.
References materials.
Referenced by cgv::render::build_render_info(), cgv::render::mesh_render_info::construct_draw_calls(), and cgv::render::mesh_render_info::construct_index_buffers().
std::vector< texture * > & cgv::render::render_info::ref_textures | ( | ) |
give write access to texture
Definition at line 163 of file render_info.cxx.
References textures.
Referenced by cgv::render::build_render_info().
std::vector< vertex_buffer * > & cgv::render::render_info::ref_vbos | ( | ) |
give write access to vbos
Definition at line 152 of file render_info.cxx.
References vbos.
Referenced by bind(), cgv::render::build_render_info(), cgv::render::mesh_render_info::construct_draw_calls(), and cgv::render::mesh_render_info::construct_element_vbo().
|
protected |
store attribute bindings
Definition at line 88 of file render_info.h.
Referenced by destruct(), draw(), get_aas(), and ref_aas().
|
protected |
store vector of render calls
Definition at line 90 of file render_info.h.
Referenced by destruct(), draw_all(), cgv::render::mesh_render_info::draw_primitive(), get_draw_calls(), and ref_draw_calls().
|
protected |
store materials
Definition at line 82 of file render_info.h.
Referenced by destruct(), draw(), get_materials(), and ref_materials().
|
protected |
store textures
Definition at line 84 of file render_info.h.
Referenced by destruct(), get_textures(), and ref_textures().
|
protected |
store buffers
Definition at line 86 of file render_info.h.
Referenced by destruct(), get_vbos(), and ref_vbos().