#pragma once #include "opengl/handles/shader_program_handle.hpp" #include "rendering/batches/point_cloud_batch.hpp" #include "assets/components/point_cloud_vertex_components.hpp" #include "rendering/modes/point_cloud_modes.hpp" #include #include "scene/lighting_setup.hpp" #include "rendering/shader_program_lookups/point_cloud_lookup.hpp" namespace rendering { class point_cloud_batch_renderer { public: using batch_components_type = point_cloud_vertex_components::flags; using batch_type = point_cloud_batch; using batch_index_type = ztu::u32; using batch_id_type = batch_index_type; using id_type = std::pair; explicit point_cloud_batch_renderer(int render_mode_count); std::optional add( batch_components_type batch_components, const zgl::point_cloud_handle& point_cloud, const aabb& bounding_box, const zgl::model_matrix_handle& transform, const shader_program_lookups::point_cloud_lookup& shader_program_lookup ); std::optional bounding_box(id_type id); bool remove(id_type id); void render( modes::point_cloud render_mode, const glm::mat4& vp_matrix, const glm::vec3& camera_position, const lighting_setup& ); protected: [[nodiscard]] std::pair lookup_batch(const batch_components_type& batch_component) const; private: int m_render_mode_count; std::vector> m_component_lookup; std::vector m_id_lookup; std::vector> m_batches; std::vector m_shader_programs; batch_id_type m_next_batch_id{ 0 }; }; }