28 #ifndef ZMOL_MOLECULE_RENDERER_HPP
29 #define ZMOL_MOLECULE_RENDERER_HPP
33 #include "opengl3.hpp"
35 #include "buffer_object.hpp"
36 #include "vertex_array_object.hpp"
37 #include "molecule_data.hpp"
38 #include "noncopyable.hpp"
39 #include "texture.hpp"
70 m_scale_factor_uniform,
72 m_border_and_flatness_uniform,
73 m_lighting_params_uniform
86 explicit molecule_shaders(std::function <
void(std::string
const &p_errormsg) >
const &p_errormsg_callback);
91 m_sphere_draw_to_screen,
92 m_sphere_draw_to_shadowmap,
93 m_sphere_draw_to_ao_atlas,
94 m_cylinder_draw_to_screen,
95 m_cylinder_draw_to_shadowmap,
96 m_cylinder_draw_to_ao_atlas
173 unsigned int const p_initial_left_viewport_offset,
unsigned int const p_initial_top_viewport_offset,
174 unsigned int const p_initial_viewport_width,
unsigned int const p_initial_viewport_height,
175 unsigned int const p_initial_atlas_size,
176 float const p_initial_radius_scale = 1.0f,
208 unsigned int const p_initial_left_viewport_offset,
unsigned int const p_initial_top_viewport_offset,
209 unsigned int const p_initial_viewport_width,
unsigned int const p_initial_viewport_height,
210 unsigned int const p_initial_atlas_size,
211 float const p_initial_radius_scale = 1.0f,
247 void set_viewport(
unsigned int const p_new_left_viewport_offset,
unsigned int const p_new_top_viewport_offset,
unsigned int const p_new_viewport_width,
unsigned int const p_new_viewport_height);
321 void render(cml::quaternionf
const &p_rotation);
332 typedef std::unique_ptr < texture > texture_uptr;
344 void init_renderer();
347 void render_internal(molecule_shaders::program_data &p_program_data,
matrix const &p_rotation,
matrix const &p_projection, passes
const p_pass);
356 void init_atlas_texture();
359 molecule_shaders &m_shaders;
361 vertex_array_object m_vao;
362 buffer_object m_vertices, m_indices;
363 molecule_data m_data;
364 std::size_t m_num_atoms, m_num_bonds;
365 float m_scale_factor;
366 float m_radius_scale;
367 float m_border_width, m_border_variance;
368 float m_ao_strength, m_direct_lighting_strength, m_shininess, m_glossiness, m_flatness;
369 cml::vector3f m_base_translation;
370 unsigned int m_left_viewport_offset, m_top_viewport_offset, m_viewport_width, m_viewport_height;
371 unsigned int m_atlas_size;
375 texture_uptr m_ao_atlas;
376 std::size_t m_ao_patch_sidelength;