diff --git a/.gitmodules b/.gitmodules
index eeed3b5..d249076 100755
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,9 @@
[submodule "libraries/include/stb"]
path = libraries/include/stb
url = https://github.com/nothings/stb
-[submodule "libraries/include/glm"]
- path = libraries/include/glm
+[submodule "libraries/stb"]
+ path = libraries/stb
+ url = https://github.com/nothings/stb
+[submodule "libraries/glm"]
+ path = libraries/glm
url = https://github.com/g-truc/glm
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index a32aab4..c12b08c 100755
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,6 +2,7 @@
-
+
+
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 23bdf7b..ac9535b 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,13 +11,13 @@ add_executable(z3d main.cpp
include/assets/components/material_components.hpp
include/assets/components/point_cloud_vertex_components.hpp
include/assets/components/mesh_vertex_components.hpp
- include/assets/dynamic_read_buffers/dynamic_material_buffer.hpp
- include/assets/dynamic_read_buffers/dynamic_mesh_buffer.hpp
- include/assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp
- include/assets/data_loaders/kitti_loader.hpp
- include/assets/data_loaders/obj_loader.hpp
- include/assets/data_loaders/stl_loader.hpp
- include/assets/data_loaders/uos_loader.hpp
+ include/assets/data/material_data.hpp
+ include/assets/data/mesh_data.hpp
+ include/assets/data/point_cloud_data.hpp
+ include/assets/file_parsers/kitti_loader.hpp
+ include/assets/file_parsers/obj_loader.hpp
+ include/assets/file_parsers/stl_loader.hpp
+ include/assets/file_parsers/uos_loader.hpp
include/assets/components/mesh_vertex_components.hpp
include/scene/camera.hpp
include/scene/flying_camera.hpp
@@ -42,8 +42,8 @@ add_executable(z3d main.cpp
include/util/string_indexer.hpp
include/util/string_literal.hpp
include/util/uix.hpp
- source/assets/data_loaders/stl_loader.cpp
- source/assets/data_loaders/obj_loader.cpp
+ source/assets/file_parsers/stl_loader.cpp
+ source/assets/file_parsers/obj_loader.cpp
source/scene/flying_camera.cpp
source/opengl/data/point_cloud_data.cpp
source/opengl/handles/shader_program_handle.ipp
@@ -62,18 +62,18 @@ add_executable(z3d main.cpp
include/opengl/shader_program_variable.hpp
include/opengl/type_utils.hpp
include/util/binary_ifstream.hpp
- source/assets/data_loaders/kitti_loader.cpp
- include/assets/data_loaders/generic/generic_3dtk_loader.hpp
- include/assets/data_loaders/uosr_loader.hpp
- include/assets/data_loaders/uos_normal_loader.hpp
- include/assets/data_loaders/uos_rgb_loader.hpp
- include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp
- source/assets/dynamic_data_loaders/dynamic_mesh_loader.cpp
- source/assets/dynamic_data_loaders/dynamic_mesh_loader.cpp
- include/assets/dynamic_data_loaders/dynamic_point_cloud_loader.hpp
- include/assets/dynamic_data_loaders/generic/base_dynamic_loader.hpp
- source/assets/dynamic_data_loaders/generic/base_dynamic_loader.ipp
- source/assets/dynamic_data_loaders/dynamic_point_cloud_loader.cpp
+ source/assets/file_parsers/kitti_loader.cpp
+ include/assets/file_parsers/generic/generic_3dtk_loader.hpp
+ include/assets/file_parsers/uosr_loader.hpp
+ include/assets/file_parsers/uos_normal_loader.hpp
+ include/assets/file_parsers/uos_rgb_loader.hpp
+ include/assets/data_loaders/mesh_loader.hpp
+ source/assets/data_loaders/mesh_loader.cpp
+ source/assets/data_loaders/mesh_loader.cpp
+ include/assets/data_loaders/point_cloud_loader.hpp
+ include/assets/data_loaders/generic/base_dynamic_loader.hpp
+ source/assets/data_loaders/generic/base_dynamic_loader.ipp
+ source/assets/data_loaders/point_cloud_loader.cpp
include/opengl/handles/matrix_handles.hpp
include/viewer/instance.hpp
include/opengl/data/material_data.hpp
@@ -86,9 +86,9 @@ add_executable(z3d main.cpp
source/viewer/instance.cpp
include/viewer/asset_loader.hpp
source/viewer/asset_loader.cpp
- include/assets/data_loaders/glsl_loader.hpp
- include/assets/dynamic_read_buffers/dynamic_shader_buffer.hpp
- source/assets/data_loaders/glsl_loader.cpp
+ include/assets/file_parsers/glsl_loader.hpp
+ include/assets/data/shader_source_data.hpp
+ source/assets/file_parsers/glsl_loader.cpp
include/viewer/settings.hpp
include/opengl/data/shader_data.hpp
source/opengl/data/shader_data.ipp
@@ -122,58 +122,49 @@ add_executable(z3d main.cpp
include/geometry/normal_estimation.hpp
include/assets/components/texture_components.hpp
include/util/enum_bitfield_operators.hpp
- include/assets/dynamic_read_buffers/dynamic_texture_buffer.hpp
- source/assets/dynamic_read_buffers/dynamic_mesh_buffer.ipp
- source/assets/dynamic_read_buffers/dynamic_material_buffer.ipp
- include/assets/dynamic_read_buffers/generic/dynamic_vertex_buffer.hpp
- source/assets/dynamic_read_buffers/dynamic_model_buffer.ipp
- source/assets/dynamic_read_buffers/dynamic_texture_buffer.ipp
- source/assets/dynamic_read_buffers/dynamic_point_cloud_buffer.ipp
- include/assets/data_loaders/mtl_loader.hpp
- include/assets/dynamic_data_loaders/dynamic_material_loader.hpp
+ include/assets/data/texture_data.hpp
+ source/assets/data/mesh_data.ipp
+ source/assets/data/material_data.ipp
+ include/assets/data/generic/vertex_array_data.hpp
+ source/assets/data/texture_data.ipp
+ source/assets/data/point_cloud_data.ipp
+ include/assets/file_parsers/mtl_loader.hpp
+ include/assets/data_loaders/material_loader.hpp
include/util/id_type.hpp
- include/assets/dynamic_data_stores/generic/generic_dynamic_store.hpp
- source/assets/dynamic_data_stores/generic/generic_dynamic_store.ipp
- include/assets/dynamic_data_stores/dynamic_material_store.hpp
- include/assets/dynamic_data_stores/dynamic_mesh_store.hpp
- include/assets/dynamic_data_stores/dynamic_point_cloud_store.hpp
+ include/assets/data_stores/generic/generic_basic_store.hpp
+ source/assets/data_stores/generic/generic_basic_store.ipp
+ include/assets/data_stores/material_store.hpp
+ include/assets/data_stores/mesh_store.hpp
+ include/assets/data_stores/point_cloud_store.hpp
include/util/result.hpp
- source/assets/data_loaders/mtl_loader.cpp
+ source/assets/file_parsers/mtl_loader.cpp
include/util/line_parser.hpp
- include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp
- source/assets/dynamic_data_loaders/dynamic_texture_loader.cpp
- include/assets/dynamic_data_stores/dynamic_texture_store.hpp
+ include/assets/data_loaders/texture_loader.hpp
+ source/assets/data_loaders/texture_loader.cpp
+ include/assets/data_stores/texture_store.hpp
include/opengl/data_managers/texture_manager.hpp
- include/assets/dynamic_data_stores/dynamic_vertex_store.hpp
include/assets/prefetch_lookups/mesh_prefetch_lookup.hpp
include/assets/prefetch_lookups/point_cloud_prefetch_lookup.hpp
include/assets/prefetch_lookups/material_prefetch_lookup.hpp
include/assets/prefetch_lookups/texture_prefetch_lookup.hpp
include/assets/prefetch_lookups/pose_prefetch_lookup.hpp
- include/assets/dynamic_data_stores/dynamic_pose_store.hpp
- include/assets/data_loaders/kitti_pose_loader.hpp
- include/assets/data_loaders/threedtk_pose_loader.hpp
- source/assets/data_loaders/threedtk_pose_loader.cpp
- include/assets/dynamic_read_buffers/dynamic_pose_buffer.hpp
- source/assets/data_loaders/kitti_pose_loader.cpp
+ include/assets/data_stores/pose_store.hpp
+ include/assets/file_parsers/kitti_pose_loader.hpp
+ include/assets/file_parsers/threedtk_pose_loader.hpp
+ source/assets/file_parsers/threedtk_pose_loader.cpp
+ include/assets/data/pose_data.hpp
+ source/assets/file_parsers/kitti_pose_loader.cpp
include/assets/prefetch_queue.hpp
include/util/string_list.hpp
- include/assets/dynamic_data_stores/dynamic_material_library_store.hpp
- include/assets/dynamic_data_stores/generic/generic_dynamic_component_store.hpp
- source/assets/dynamic_data_stores/generic/generic_dynamic_component_store.ipp
- source/assets/dynamic_data_stores/dynamic_material_store.cpp
- include/assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.hpp
- source/assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.ipp
- source/assets/dynamic_data_stores/dynamic_mesh_store.cpp
- include/assets/dynamic_data_stores/generic/generic_dynamic_indexed_component_array_store.hpp
- source/assets/dynamic_data_stores/dynamic_point_cloud_store.cpp
- include/assets/dynamic_read_buffers/dynamic_material_library_buffer.hpp
- include/assets/dynamic_data_loaders/dynamic_material_library_loader.hpp
+ include/assets/data_stores/material_library_store.hpp
+ source/assets/data_stores/generic/generic_dynamic_component_array_store.ipp
+ include/assets/data/material_library_data.hpp
+ include/assets/data_loaders/material_library_loader.hpp
include/assets/prefetch_lookups/material_library_prefetch_lookup.hpp
include/assets/prefetch_lookups/shader_prefetch_lookup.hpp
- include/assets/dynamic_data_stores/dynamic_shader_source_store.hpp
- include/assets/data_loaders/generic/generic_3dtk_loader.hpp
- source/assets/data_loaders/generic/generic_3dtk_loader.ipp
+ include/assets/data_stores/shader_source_store.hpp
+ include/assets/file_parsers/generic/generic_3dtk_loader.hpp
+ source/assets/file_parsers/generic/generic_3dtk_loader.ipp
include/assets/prefetch_lookup.hpp
source/assets/prefetch_lookups/pose_prefetch_lookup.cpp
include/assets/dynamic_data_store.hpp
@@ -202,7 +193,6 @@ add_executable(z3d main.cpp
include/util/reference_counter.hpp
include/opengl/resource_management/resource_manager.hpp
source/opengl/resource_management/resource_manager.ipp
- include/opengl/data_managers/buffer_manager.hpp
include/opengl/data_managers/shader_manager.hpp
include/opengl/data_managers/mesh_vertex_buffer_manager.hpp
source/opengl/data_managers/mesh_vertex_buffer_manager.cpp
@@ -215,13 +205,32 @@ add_executable(z3d main.cpp
include/opengl/handles/index_buffer_handle.hpp
source/opengl/handles/index_buffer_handle.ipp
include/opengl/metadata/texture_metadata.hpp
- include/opengl/metadata/vertex_buffer_metadata.hpp
+ include/opengl/vertex_buffer_utils.hpp
+ include/opengl/data_managers/mesh_index_buffer_manager.hpp
+ include/opengl/metadata/index_buffer_metadata.hpp
+ source/opengl/data_managers/mesh_index_buffer_manager.cpp
+ include/opengl/data_managers/point_cloud_vertex_buffer_manager.hpp
+ source/opengl/data_managers/point_cloud_vertex_buffer_manager.cpp
+ include/assets/data_views/mesh_view.hpp
+ include/assets/data_views/point_cloud_view.hpp
+ include/assets/data_views/shader_source_view.hpp
+ include/assets/data_stores/generic/generic_mesh_store.hpp
+ source/assets/data_stores/generic/generic_mesh_store.ipp
+ include/assets/data_stores/generic/generic_point_cloud_store.hpp
+ source/assets/data_stores/generic/generic_point_cloud_store.ipp
+ include/assets/data_views/material_view.hpp
+ include/assets/data_views/texture_view.hpp
+ include/assets/data_stores/generic/generic_material_store.hpp
+ source/assets/data_stores/generic/generic_material_store.ipp
+ source/assets/data_stores/shader_source_store.ipp
+ include/opengl/metadata/mesh_vertex_buffer_metadata.hpp
+ include/opengl/metadata/point_cloud_vertex_buffer_metadata.hpp
)
target_include_directories(z3d PRIVATE include)
target_include_directories(z3d PRIVATE source) # for ipp headers
-target_include_directories(z3d PRIVATE libraries/include/glm)
-target_include_directories(z3d PRIVATE libraries/include/stb)
+
+add_subdirectory(libraries)
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
diff --git a/include/assets/components/material_components.hpp b/include/assets/components/material_components.hpp
index 58871c7..b3f01ad 100644
--- a/include/assets/components/material_components.hpp
+++ b/include/assets/components/material_components.hpp
@@ -1,20 +1,21 @@
#pragma once
#include
-#include "../dynamic_read_buffers"
+
+#include "assets/data_stores/texture_store.hpp"
#include "assets/data/surface_properties.hpp"
#include "util/enum_bitfield_operators.hpp"
-namespace components::material
+namespace assets::material_components
{
-using surface_properties = ::surface_properties;
+using surface_properties = surface_properties;
using transparency = float;
-using ambient_color_texture = ::dynamic_texture_data;
-using diffuse_color_texture = ::dynamic_texture_data;
-using specular_color_texture = ::dynamic_texture_data;
-using shininess_texture = ::dynamic_texture_data;
-using alpha_texture = ::dynamic_texture_data;
-using bump_texture = ::dynamic_texture_data;
+using ambient_color_texture = texture_store::id_type;
+using diffuse_color_texture = texture_store::id_type;
+using specular_color_texture = texture_store::id_type;
+using shininess_texture = texture_store::id_type;
+using alpha_texture = texture_store::id_type;
+using bump_texture = texture_store::id_type;
namespace indices
{
@@ -56,4 +57,4 @@ constexpr inline auto count = std::tuple_size_v;
} // namespace material_component
-DEFINE_ENUM_BITFIELD_OPERATORS(components::material::flags)
+DEFINE_ENUM_BITFIELD_OPERATORS(assets::material_components::flags)
diff --git a/include/assets/components/mesh_vertex_components.hpp b/include/assets/components/mesh_vertex_components.hpp
index 0e1d2dd..87be280 100755
--- a/include/assets/components/mesh_vertex_components.hpp
+++ b/include/assets/components/mesh_vertex_components.hpp
@@ -4,7 +4,8 @@
#include
#include "util/enum_bitfield_operators.hpp"
-namespace components::mesh_vertex {
+namespace assets::mesh_vertex_components
+{
using position = std::array;
using normal = std::array;
@@ -35,6 +36,6 @@ enum class flags : std::uint8_t
using all = std::tuple;
constexpr inline auto count = std::tuple_size_v;
-} // namespace components::mesh_vertex
+} // namespace mesh_vertex_components
-DEFINE_ENUM_BITFIELD_OPERATORS(components::mesh_vertex::flags)
+DEFINE_ENUM_BITFIELD_OPERATORS(assets::mesh_vertex_components::flags)
diff --git a/include/assets/components/point_cloud_vertex_components.hpp b/include/assets/components/point_cloud_vertex_components.hpp
index ebec5c5..1f8c561 100755
--- a/include/assets/components/point_cloud_vertex_components.hpp
+++ b/include/assets/components/point_cloud_vertex_components.hpp
@@ -4,7 +4,8 @@
#include
#include "util/enum_bitfield_operators.hpp"
-namespace components::point_cloud_vertex {
+namespace assets::point_cloud_vertex_components
+{
using position = std::array;
using normal = std::array;
@@ -32,6 +33,6 @@ enum class flags : std::uint8_t
using all = std::tuple;
constexpr inline auto count = std::tuple_size_v;
-} // namespace components::point_cloud_vertex
+} // namespace point_cloud_vertex_components
-DEFINE_ENUM_BITFIELD_OPERATORS(components::point_cloud_vertex::flags)
+DEFINE_ENUM_BITFIELD_OPERATORS(assets::point_cloud_vertex_components::flags)
diff --git a/include/assets/components/texture_components.hpp b/include/assets/components/texture_components.hpp
index 496fa46..651eb81 100644
--- a/include/assets/components/texture_components.hpp
+++ b/include/assets/components/texture_components.hpp
@@ -4,7 +4,8 @@
#include
#include "util/enum_bitfield_operators.hpp"
-namespace components::texture {
+namespace assets::texture_components
+{
using red = std::uint8_t;
using green = std::uint8_t;
@@ -24,6 +25,6 @@ enum class flags : std::uint8_t
using all = std::tuple;
constexpr inline auto count = std::tuple_size_v;
-} // namespace components::texture
+} // namespace texture_components
-DEFINE_ENUM_BITFIELD_OPERATORS(components::texture::flags)
\ No newline at end of file
+DEFINE_ENUM_BITFIELD_OPERATORS(assets::texture_components::flags)
diff --git a/include/assets/dynamic_read_buffers/generic/dynamic_vertex_buffer.hpp b/include/assets/data/generic/vertex_array_data.hpp
similarity index 65%
rename from include/assets/dynamic_read_buffers/generic/dynamic_vertex_buffer.hpp
rename to include/assets/data/generic/vertex_array_data.hpp
index c18d138..2ebb9c0 100644
--- a/include/assets/dynamic_read_buffers/generic/dynamic_vertex_buffer.hpp
+++ b/include/assets/data/generic/vertex_array_data.hpp
@@ -1,16 +1,15 @@
#pragma once
-#include "util/uix.hpp"
-#include
#include
-#include "GL/glew.h"
template
-struct dynamic_vertex_buffer {
+struct vertex_array_data
+{
+ C component_flags;
std::tuple...> vertices{};
protected:
- inline void clear_vertices()
+ void clear_vertices()
{
std::apply(
[](auto&... vertex_opt) {
diff --git a/include/assets/data/material_data.hpp b/include/assets/data/material_data.hpp
new file mode 100755
index 0000000..3ac8ccb
--- /dev/null
+++ b/include/assets/data/material_data.hpp
@@ -0,0 +1,56 @@
+#pragma once
+
+#include
+
+#include "assets/components/material_components.hpp"
+#include "assets/data_stores/texture_store.hpp"
+
+namespace assets
+{
+
+struct material_data
+{
+
+ material_data() = default;
+
+ material_components::surface_properties& initialized_surface_properties();
+
+ [[nodiscard]] inline std::optional& surface_properties();
+ [[nodiscard]] inline std::optional& transparency();
+ [[nodiscard]] inline std::optional& ambient_color_texture_id();
+ [[nodiscard]] inline std::optional& diffuse_color_texture_id();
+ [[nodiscard]] inline std::optional& specular_color_texture_id();
+ [[nodiscard]] inline std::optional& shininess_texture_id();
+ [[nodiscard]] inline std::optional& alpha_texture_id();
+ [[nodiscard]] inline std::optional& bump_texture_id();
+
+ [[nodiscard]] inline const std::optional& surface_properties() const;
+ [[nodiscard]] inline const std::optional& transparency() const;
+ [[nodiscard]] inline const std::optional& ambient_color_texture_id() const;
+ [[nodiscard]] inline const std::optional& diffuse_color_texture_id() const;
+ [[nodiscard]] inline const std::optional& specular_color_texture_id() const;
+ [[nodiscard]] inline const std::optional& shininess_texture_id() const;
+ [[nodiscard]] inline const std::optional& alpha_texture_id() const;
+ [[nodiscard]] inline const std::optional& bump_texture_id() const;
+
+ inline void clear();
+
+ std::tuple<
+ std::optional,
+ std::optional,
+ std::optional,
+ std::optional,
+ std::optional,
+ std::optional,
+ std::optional,
+ std::optional
+ > data{
+ std::nullopt, std::nullopt, std::nullopt, std::nullopt, std::nullopt, std::nullopt, std::nullopt, std::nullopt
+ };
+};
+
+}
+
+#define INCLUDE_DYNAMIC_MATERIAL_DATA_IMPLEMENTATION
+#include "assets/data/material_data.ipp"
+#undef INCLUDE_DYNAMIC_MATERIAL_DATA_IMPLEMENTATION
diff --git a/include/assets/data/material_library_data.hpp b/include/assets/data/material_library_data.hpp
new file mode 100644
index 0000000..6755c66
--- /dev/null
+++ b/include/assets/data/material_library_data.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "util/string_lookup.hpp"
+#include "assets/data_stores/material_store.hpp"
+
+namespace assets
+{
+
+using material_library_data = ztu::string_lookup;
+
+}
diff --git a/include/assets/data/mesh_data.hpp b/include/assets/data/mesh_data.hpp
new file mode 100644
index 0000000..43cb9e8
--- /dev/null
+++ b/include/assets/data/mesh_data.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#include
+#include
+
+#include "util/uix.hpp"
+#include "assets/components/mesh_vertex_components.hpp"
+#include "generic/vertex_array_data.hpp"
+#include "assets/data_stores/material_store.hpp"
+
+namespace assets
+{
+
+class mesh_data : public vertex_array_data<
+ mesh_vertex_components::flags,
+ mesh_vertex_components::position,
+ mesh_vertex_components::normal,
+ mesh_vertex_components::tex_coord,
+ mesh_vertex_components::color,
+ mesh_vertex_components::reflectance
+> {
+public:
+ using index_type = ztu::u32;
+ using triangle_type = std::array;
+
+ [[nodiscard]] inline std::vector& positions();
+ [[nodiscard]] inline std::vector& normals();
+ [[nodiscard]] inline std::vector& tex_coords();
+ [[nodiscard]] inline std::vector& colors();
+ [[nodiscard]] inline std::vector& reflectances();
+ [[nodiscard]] inline std::vector& triangles();
+ [[nodiscard]] inline auto& material_id();
+
+ [[nodiscard]] inline const std::vector& positions() const;
+ [[nodiscard]] inline const std::vector& normals() const;
+ [[nodiscard]] inline const std::vector& tex_coords() const;
+ [[nodiscard]] inline const std::vector& colors() const;
+ [[nodiscard]] inline const std::vector& reflectances() const;
+ [[nodiscard]] inline const std::vector& triangles() const;
+ [[nodiscard]] inline const auto& material_id() const;
+
+ inline void clear();
+
+private:
+ std::vector m_triangles{};
+ material_store::id_type m_material_id{};
+};
+
+}
+
+#define INCLUDE_DYNAMIC_MESH_DATA_IMPLEMENTATION
+#include "assets/data/mesh_data.ipp"
+#undef INCLUDE_DYNAMIC_MESH_DATA_IMPLEMENTATION
diff --git a/include/assets/data/point_cloud_data.hpp b/include/assets/data/point_cloud_data.hpp
new file mode 100644
index 0000000..65c9d2a
--- /dev/null
+++ b/include/assets/data/point_cloud_data.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "assets/components/point_cloud_vertex_components.hpp"
+
+#include
+#include
+#include "generic/vertex_array_data.hpp"
+
+namespace assets
+{
+
+class point_cloud_data : public vertex_array_data<
+ point_cloud_vertex_components::flags,
+ point_cloud_vertex_components::position,
+ point_cloud_vertex_components::normal,
+ point_cloud_vertex_components::color,
+ point_cloud_vertex_components::reflectance
+> {
+public:
+ [[nodiscard]] inline std::vector& positions();
+ [[nodiscard]] inline std::vector& normals();
+ [[nodiscard]] inline std::vector& colors();
+ [[nodiscard]] inline std::vector& reflectances();
+
+ [[nodiscard]] inline const std::vector& positions() const;
+ [[nodiscard]] inline const std::vector& normals() const;
+ [[nodiscard]] inline const std::vector& colors() const;
+ [[nodiscard]] inline const std::vector& reflectances() const;
+
+ inline void clear();
+};
+
+}
+
+#define INCLUDE_DYNAMIC_TEXTURE_DATA_IMPLEMENTATION
+#include "assets/data/point_cloud_data.ipp"
+#undef INCLUDE_DYNAMIC_TEXTURE_DATA_IMPLEMENTATION
\ No newline at end of file
diff --git a/include/assets/data/pose_data.hpp b/include/assets/data/pose_data.hpp
new file mode 100644
index 0000000..b413d80
--- /dev/null
+++ b/include/assets/data/pose_data.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "glm/mat4x4.hpp"
+
+namespace assets
+{
+
+using pose_data = glm::mat4;
+
+}
diff --git a/include/assets/data/shader_source_data.hpp b/include/assets/data/shader_source_data.hpp
new file mode 100644
index 0000000..a99ac54
--- /dev/null
+++ b/include/assets/data/shader_source_data.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include
+
+namespace assets
+{
+
+struct shader_source_data
+{
+ std::vector source{};
+
+ void clear()
+ {
+ source.clear();
+ }
+};
+
+}
diff --git a/include/assets/data/surface_properties.hpp b/include/assets/data/surface_properties.hpp
index dce0c1e..bbd980e 100644
--- a/include/assets/data/surface_properties.hpp
+++ b/include/assets/data/surface_properties.hpp
@@ -2,10 +2,15 @@
#include
+namespace assets
+{
+
struct surface_properties
{
std::array ambient_filter{ 0.7f, 0.7f, 0.7f };
std::array diffuse_filter{ 0.466f, 0.466f, 0.7922f };
std::array specular_filter{ 0.5974f, 0.2084f, 0.2084f };
float shininess{ 100.2237f };
-};
\ No newline at end of file
+};
+
+}
diff --git a/include/assets/dynamic_read_buffers/dynamic_texture_buffer.hpp b/include/assets/data/texture_data.hpp
similarity index 68%
rename from include/assets/dynamic_read_buffers/dynamic_texture_buffer.hpp
rename to include/assets/data/texture_data.hpp
index 4437397..c82e00f 100755
--- a/include/assets/dynamic_read_buffers/dynamic_texture_buffer.hpp
+++ b/include/assets/data/texture_data.hpp
@@ -6,7 +6,11 @@
#include
#include "assets/components/texture_components.hpp"
-class dynamic_texture_buffer {
+namespace assets
+{
+
+class texture_data
+{
public:
using value_type = std::uint8_t;
using dim_type = std::int32_t;
@@ -19,24 +23,24 @@ public:
using iterator = pointer;
using const_iterator = const_pointer;
- dynamic_texture_buffer() = default;
+ texture_data() = default;
- inline dynamic_texture_buffer(
- std::unique_ptr&& data,
+ inline texture_data(
+ std::unique_ptr&& data,
dim_type width,
dim_type height,
- components::texture::flags components
+ texture_components::flags components
);;
- inline dynamic_texture_buffer(const dynamic_texture_buffer&);
+ inline texture_data(const texture_data&);
- inline dynamic_texture_buffer(dynamic_texture_buffer&&) noexcept;
+ inline texture_data(texture_data&&) noexcept;
- [[nodiscard]] inline dynamic_texture_buffer& operator=(const dynamic_texture_buffer&);
+ [[nodiscard]] inline texture_data& operator=(const texture_data&);
- [[nodiscard]] inline dynamic_texture_buffer& operator=(dynamic_texture_buffer&&) noexcept;
+ [[nodiscard]] inline texture_data& operator=(texture_data&&) noexcept;
- [[nodiscard]] inline components::texture::flags components() const;
+ [[nodiscard]] inline texture_components::flags components() const;
[[nodiscard]] inline dim_type width() const;
@@ -71,9 +75,11 @@ public:
private:
std::unique_ptr m_data{ nullptr };
dim_type m_width{ 0 }, m_height{ 0 };
- components::texture::flags m_components{ components::texture::flags::none };
+ texture_components::flags m_components{ texture_components::flags::none };
};
+}
+
#define INCLUDE_DYNAMIC_TEXTURE_DATA_IMPLEMENTATION
-#include "assets/dynamic_read_buffers/dynamic_texture_buffer.ipp"
+#include "assets/data/texture_data.ipp"
#undef INCLUDE_DYNAMIC_TEXTURE_DATA_IMPLEMENTATION
diff --git a/include/assets/dynamic_data_loaders/generic/base_dynamic_loader.hpp b/include/assets/data_loaders/generic/base_dynamic_loader.hpp
similarity index 87%
rename from include/assets/dynamic_data_loaders/generic/base_dynamic_loader.hpp
rename to include/assets/data_loaders/generic/base_dynamic_loader.hpp
index bf0d819..07ca51f 100644
--- a/include/assets/dynamic_data_loaders/generic/base_dynamic_loader.hpp
+++ b/include/assets/data_loaders/generic/base_dynamic_loader.hpp
@@ -3,12 +3,14 @@
#include
#include
-#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
+#include "../../data_stores"
#include "util/uix.hpp"
#include "util/string_lookup.hpp"
#include "util/id_type.hpp"
#include "util/result.hpp"
+
+
template
class base_dynamic_loader
{
@@ -26,6 +28,7 @@ public:
protected:
+ // TODO this seems like I modified this to something that does not make sense
template
ztu::result invoke_with_matching_loader(loader_id_type loader_id, F&& f);
@@ -35,5 +38,5 @@ protected:
};
#define INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION
-#include "assets/dynamic_data_loaders/generic/base_dynamic_loader.ipp"
+#include "../../data_loaders"
#undef INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION
diff --git a/include/assets/dynamic_data_loaders/dynamic_material_library_loader.hpp b/include/assets/data_loaders/material_library_loader.hpp
similarity index 59%
rename from include/assets/dynamic_data_loaders/dynamic_material_library_loader.hpp
rename to include/assets/data_loaders/material_library_loader.hpp
index 8c508ab..875628d 100644
--- a/include/assets/dynamic_data_loaders/dynamic_material_library_loader.hpp
+++ b/include/assets/data_loaders/material_library_loader.hpp
@@ -2,16 +2,21 @@
#include "assets/prefetch_queue.hpp"
#include "assets/components/material_components.hpp"
-#include "assets/dynamic_read_buffers/dynamic_material_library_buffer.hpp"
-#include "assets/dynamic_data_stores/dynamic_material_library_store.hpp"
+#include "assets/data/material_library_data.hpp"
+#include "assets/data_stores/material_store.hpp"
#include "assets/prefetch_lookups/material_library_prefetch_lookup.hpp"
#include "generic/base_dynamic_loader.hpp"
-#include "assets/data_loaders/mtl_loader.hpp"
#include "util/string_list.hpp"
-class dynamic_material_library_loader : public base_dynamic_loader<
- components::material::flags,
+#include "assets/file_parsers/mtl_loader.hpp"
+
+// TODO not implemented?!?
+namespace assets
+{
+
+class material_library_loader : public base_dynamic_loader<
+ material_components::flags,
mtl_loader
> {
public:
@@ -25,12 +30,14 @@ public:
[[nodiscard]] std::error_code load(
loader_id_type loader_id,
const ztu::string_list& directories,
- dynamic_material_library_store& store,
- dynamic_material_store& material_store,
+ material_library_store& store,
+ material_store& material_store,
material_library_prefetch_lookup& id_lookup,
bool pedantic = false
);
private:
- dynamic_material_library_buffer m_buffer{};
+ material_library_data m_buffer{};
};
+
+}
diff --git a/include/assets/dynamic_data_loaders/dynamic_material_loader.hpp b/include/assets/data_loaders/material_loader.hpp
similarity index 66%
rename from include/assets/dynamic_data_loaders/dynamic_material_loader.hpp
rename to include/assets/data_loaders/material_loader.hpp
index 934f87f..b35eb8d 100644
--- a/include/assets/dynamic_data_loaders/dynamic_material_loader.hpp
+++ b/include/assets/data_loaders/material_loader.hpp
@@ -4,14 +4,17 @@
#include "assets/components/material_components.hpp"
#include "generic/base_dynamic_loader.hpp"
-#include "assets/data_loaders/mtl_loader.hpp"
-#include "assets/dynamic_data_stores/dynamic_material_store.hpp"
+#include "assets/data_stores/material_store.hpp"
+#include "assets/data/material_data.hpp"
#include "assets/prefetch_lookups/material_prefetch_lookup.hpp"
#include "util/string_list.hpp"
-class dynamic_material_loader : public base_dynamic_loader<
- components::material::flags
- // TODO no loaders
+namespace assets
+{
+
+class material_loader : public base_dynamic_loader<
+ material_components::flags
+ // TODO no loaders (mtl is for material libraries)
> {
public:
@@ -24,11 +27,13 @@ public:
[[nodiscard]] std::error_code load(
loader_id_type loader_id,
const ztu::string_list& directories,
- dynamic_material_store& store,
+ material_store& store,
material_prefetch_lookup& id_lookup,
bool pedantic = false
);
private:
- dynamic_material_buffer m_buffer{};
+ material_data m_buffer{};
};
+
+}
diff --git a/include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp b/include/assets/data_loaders/mesh_loader.hpp
similarity index 57%
rename from include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp
rename to include/assets/data_loaders/mesh_loader.hpp
index 3d02ed4..2dbfb0f 100644
--- a/include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp
+++ b/include/assets/data_loaders/mesh_loader.hpp
@@ -3,15 +3,17 @@
#include "generic/base_dynamic_loader.hpp"
#include
-#include "assets/dynamic_read_buffers/dynamic_mesh_buffer.hpp"
-#include "assets/dynamic_data_stores/dynamic_mesh_store.hpp"
-#include "assets/data_loaders/obj_loader.hpp"
-#include "assets/data_loaders/stl_loader.hpp"
+#include "assets/data/mesh_data.hpp"
+#include "assets/data_stores/mesh_store.hpp"
+#include "assets/file_parsers/obj_loader.hpp"
+#include "assets/file_parsers/stl_loader.hpp"
#include "assets/prefetch_lookups/mesh_prefetch_lookup.hpp"
+namespace assets
+{
-class dynamic_mesh_loader : public base_dynamic_loader<
- components::mesh_vertex::flags,
+class mesh_loader : public base_dynamic_loader<
+ mesh_vertex_components::flags,
obj_loader,
stl_loader
> {
@@ -25,11 +27,13 @@ public:
[[nodiscard]] std::error_code load(
loader_id_type loader_id,
const ztu::string_list& directories,
- dynamic_mesh_store& store,
+ mesh_store& store,
mesh_prefetch_lookup& id_lookup,
bool pedantic = false
);
private:
- dynamic_mesh_buffer m_buffer{};
+ mesh_data m_buffer{};
};
+
+}
diff --git a/include/assets/dynamic_data_loaders/dynamic_point_cloud_loader.hpp b/include/assets/data_loaders/point_cloud_loader.hpp
similarity index 54%
rename from include/assets/dynamic_data_loaders/dynamic_point_cloud_loader.hpp
rename to include/assets/data_loaders/point_cloud_loader.hpp
index 7c7b601..8f90738 100644
--- a/include/assets/dynamic_data_loaders/dynamic_point_cloud_loader.hpp
+++ b/include/assets/data_loaders/point_cloud_loader.hpp
@@ -5,20 +5,22 @@
#include "assets/prefetch_queue.hpp"
#include "generic/base_dynamic_loader.hpp"
-#include "assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp"
-#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
-
-#include "assets/data_loaders/kitti_loader.hpp"
-#include "assets/data_loaders/uos_loader.hpp"
-#include "assets/data_loaders/uos_normal_loader.hpp"
-#include "assets/data_loaders/uos_rgb_loader.hpp"
-#include "assets/data_loaders/uosr_loader.hpp"
+#include "assets/data/point_cloud_data.hpp"
+#include "assets/data_stores/point_cloud_store.hpp"
#include "assets/prefetch_lookups/point_cloud_prefetch_lookup.hpp"
-
#include "util/string_list.hpp"
-class dynamic_point_cloud_loader : public base_dynamic_loader<
- components::point_cloud_vertex::flags,
+#include "assets/file_parsers/kitti_loader.hpp"
+#include "assets/file_parsers/uos_loader.hpp"
+#include "assets/file_parsers/uos_normal_loader.hpp"
+#include "assets/file_parsers/uos_rgb_loader.hpp"
+#include "assets/file_parsers/uosr_loader.hpp"
+
+namespace assets
+{
+
+class point_cloud_loader : public base_dynamic_loader<
+ point_cloud_vertex_components::flags,
kitti_loader,
uos_loader,
uos_normal_loader,
@@ -36,11 +38,13 @@ public:
[[nodiscard]] std::error_code load(
loader_id_type loader_id,
const ztu::string_list& directories,
- dynamic_point_cloud_store& store,
+ point_cloud_store& store,
point_cloud_prefetch_lookup& id_lookup,
bool pedantic = false
);
private:
- dynamic_point_cloud_buffer m_buffer{};
+ point_cloud_data m_buffer{};
};
+
+}
diff --git a/include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp b/include/assets/data_loaders/texture_loader.hpp
similarity index 50%
rename from include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp
rename to include/assets/data_loaders/texture_loader.hpp
index a703253..51d2ce9 100644
--- a/include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp
+++ b/include/assets/data_loaders/texture_loader.hpp
@@ -8,35 +8,22 @@
#include "util/result.hpp"
#include "assets/components/texture_components.hpp"
-#include "assets/dynamic_read_buffers/dynamic_texture_buffer.hpp"
-#include "assets/dynamic_data_stores/dynamic_texture_store.hpp"
-#include "assets/dynamic_data_loader_ctx.hpp"
+#include "assets/data/texture_data.hpp"
+#include "assets/data_stores/texture_store.hpp"
+#include "assets/dynamic_data_store.hpp"
#include "assets/prefetch_queue.hpp"
#include "assets/prefetch_lookups/texture_prefetch_lookup.hpp"
#include "util/string_list.hpp"
-/*
-* [[nodiscard]] std::error_code prefetch(
-loader_id_type loader_id,
-const ztu::string_list& directories,
-prefetch_queue& queue
-);
+namespace assets
+{
-[[nodiscard]] std::error_code load(
-loader_id_type loader_id,
-const ztu::string_list& directories,
-dynamic_point_cloud_store& store,
-point_cloud_prefetch_lookup& id_lookup,
-bool pedantic = false
-);
-*/
-
-class dynamic_texture_loader
+class texture_loader
{
public:
- using loader_id_type = ztu::id_type_for;
+ using loader_id_type = ztu::id_type_for;
- explicit dynamic_texture_loader(components::texture::flags enabled_components);
+ explicit texture_loader(texture_components::flags enabled_components);
[[nodiscard]] std::optional find_loader(const std::string_view& name);
@@ -49,12 +36,14 @@ public:
[[nodiscard]] std::error_code load(
loader_id_type loader_id,
const ztu::string_list& directories,
- dynamic_texture_store& store,
+ texture_store& store,
texture_prefetch_lookup& id_lookup,
bool pedantic = false
);
private:
ztu::string_lookup m_loader_id_lookup{};
- components::texture::flags m_enabled_components{ components::texture::flags::none };
+ texture_components::flags m_enabled_components{ texture_components::flags::none };
};
+
+}
diff --git a/include/assets/dynamic_data_stores/generic/generic_dynamic_store.hpp b/include/assets/data_stores/generic/generic_basic_store.hpp
similarity index 72%
rename from include/assets/dynamic_data_stores/generic/generic_dynamic_store.hpp
rename to include/assets/data_stores/generic/generic_basic_store.hpp
index ebb6f4f..0101725 100644
--- a/include/assets/dynamic_data_stores/generic/generic_dynamic_store.hpp
+++ b/include/assets/data_stores/generic/generic_basic_store.hpp
@@ -7,10 +7,10 @@
#include "util/id_type.hpp"
template
-class generic_dynamic_store
+class generic_basic_store
{
public:
- using id_type = ztu::id_type_for;
+ using id_type = ztu::id_type_for;
using container_type = std::vector;
using iterator_type = typename container_type::iterator;
using const_iterator = typename container_type::const_iterator;
@@ -35,6 +35,6 @@ private:
id_type m_next_data_id{ 1 };
};
-#define INCLUDE_GENERIC_DYNAMIC_STORE_IMPLEMENTATION
-#include "assets/dynamic_data_stores/generic_dynamic_store.ipp"
-#undef INCLUDE_GENERIC_DYNAMIC_STORE_IMPLEMENTATION
+#define INCLUDE_GENERIC_BASIC_STORE_IMPLEMENTATION
+#include "assets/data_stores/generic/generic_basic_store.ipp"
+#undef INCLUDE_GENERIC_BASIC_STORE_IMPLEMENTATION
diff --git a/include/assets/data_stores/generic/generic_material_store.hpp b/include/assets/data_stores/generic/generic_material_store.hpp
new file mode 100644
index 0000000..6e162d8
--- /dev/null
+++ b/include/assets/data_stores/generic/generic_material_store.hpp
@@ -0,0 +1,155 @@
+#pragma once
+
+#include "assets/components/material_components.hpp"
+#include "assets/data/material_data.hpp"
+#include "assets/data_views/material_view.hpp"
+
+
+namespace assets::detail
+{
+
+template
+class generic_material_store;
+
+template
+class generic_material_store_iterator
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using component_flag_type = material_components::flags;
+ using id_type = ztu::id_type_for, ztu::u32>;
+ using value_type = std::pair;
+ using flag_count_type = std::tuple;
+
+ using id_iterator_type = id_type*;
+ using component_iterator_type = std::tuple...>;
+ using flag_count_iterator_type = const flag_count_type*;
+
+ using offsets_type = std::array;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type;
+ using iterator_category = std::random_access_iterator_tag;
+
+private:
+ friend generic_material_store;
+
+ generic_material_store_iterator(
+ id_iterator_type ids,
+ const component_iterator_type& components,
+ flag_count_iterator_type flag_counts,
+ std::size_t index,
+ const offsets_type& offsets
+ );
+
+public:
+ constexpr generic_material_store_iterator() noexcept = default;
+
+ constexpr generic_material_store_iterator(const generic_material_store_iterator&) noexcept = default;
+ constexpr generic_material_store_iterator(generic_material_store_iterator&&) noexcept = default;
+
+ constexpr generic_material_store_iterator& operator=(const generic_material_store_iterator&) noexcept = default;
+ constexpr generic_material_store_iterator& operator=(generic_material_store_iterator&&) noexcept = default;
+
+ reference operator*() const;
+
+ generic_material_store_iterator& operator++();
+ generic_material_store_iterator operator++(int);
+ generic_material_store_iterator& operator--();
+ generic_material_store_iterator operator--(int);
+
+ generic_material_store_iterator& operator+=(difference_type n);
+ generic_material_store_iterator& operator-=(difference_type n);
+ generic_material_store_iterator operator+(difference_type n) const;
+ generic_material_store_iterator operator-(difference_type n) const;
+ difference_type operator-(const generic_material_store_iterator& other) const;
+
+ reference operator[](difference_type n) const;
+
+ bool operator==(const generic_material_store_iterator& other) const;
+ bool operator!=(const generic_material_store_iterator& other) const;
+ bool operator<(const generic_material_store_iterator& other) const;
+ bool operator<=(const generic_material_store_iterator& other) const;
+ bool operator>(const generic_material_store_iterator& other) const;
+ bool operator>=(const generic_material_store_iterator& other) const;
+
+protected:
+ template
+ static bool is_component_enabled(component_flag_type flag);
+
+ template
+ void calc_offsets(std::index_sequence, difference_type n);
+
+ template
+ reference dereference(std::index_sequence) const;
+
+private:
+ id_iterator_type m_ids{};
+ component_iterator_type m_components{};
+ flag_count_iterator_type m_flag_counts{};
+ size_type m_index{};
+ offsets_type m_offsets{};
+};
+
+
+template
+class generic_material_store
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using component_flag_type = material_components::flags;
+
+ using iterator_type = generic_material_store_iterator;
+ using const_iterator = generic_material_store_iterator...>;
+ using view_type = std::ranges::subrange;
+ using const_view_type = std::ranges::subrange;
+ using id_type = ztu::id_type_for;
+
+ id_type add(const material_data& material);
+
+ [[nodiscard]] std::pair find(id_type id);
+
+ [[nodiscard]] std::pair find(id_type id) const;
+
+ void remove(const iterator_type& it);
+
+ void clear();
+
+ iterator_type begin();
+
+ iterator_type end();
+
+ const_iterator begin() const;
+
+ const_iterator end() const;
+
+ const_iterator cbegin() const;
+
+ const_iterator cend() const;
+
+ view_type view();
+
+ const_view_type view() const;
+
+protected:
+ std::tuple...> component_iterators();
+
+ std::tuple>...> component_iterators() const;
+
+ std::array array_counts() const;
+
+private:
+ std::vector m_ids;
+ std::tuple...> m_component_arrays;
+ std::vector m_component_flag_counts;
+ id_type m_next_data_id{ 1 };
+};
+
+}
+
+
+#define INCLUDE_GENERIC_MATERIAL_STORE_IMPLEMENTATION
+#include "assets/data_stores/generic/generic_material_store.ipp"
+#undef INCLUDE_GENERIC_MATERIAL_STORE_IMPLEMENTATION
diff --git a/include/assets/data_stores/generic/generic_mesh_store.hpp b/include/assets/data_stores/generic/generic_mesh_store.hpp
new file mode 100644
index 0000000..3ab9bf0
--- /dev/null
+++ b/include/assets/data_stores/generic/generic_mesh_store.hpp
@@ -0,0 +1,167 @@
+#pragma once
+
+#include "assets/components/mesh_vertex_components.hpp"
+#include "assets/data_stores/material_store.hpp"
+#include "assets/data/mesh_data.hpp"
+#include "assets/data_views/mesh_view.hpp"
+
+namespace assets::detail
+{
+
+template
+class generic_mesh_store;
+
+template
+class generic_mesh_store_iterator
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using index_type = mesh_data::index_type;
+ using material_id_type = material_store::id_type;
+ using component_flag_type = mesh_vertex_components::flags;
+ using id_type = ztu::id_type_for, ztu::u32>;
+ using value_type = std::pair;
+ using flag_count_type = std::tuple;
+
+ using id_iterator_type = id_type*;
+ using component_iterator_type = std::tuple...>;
+ using index_iterator_type = index_type*;
+ using flag_count_iterator_type = const flag_count_type*;
+ using material_id_iterator_type = material_id_type*;
+
+ using offsets_type = std::array;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type;
+ using iterator_category = std::random_access_iterator_tag;
+
+private:
+ friend generic_mesh_store;
+
+ generic_mesh_store_iterator(
+ id_iterator_type ids,
+ index_iterator_type indices,
+ const component_iterator_type& components,
+ material_id_iterator_type material_ids,
+ flag_count_iterator_type flag_counts,
+ std::size_t index,
+ const offsets_type& offsets
+ );
+
+public:
+ constexpr generic_mesh_store_iterator() noexcept = default;
+
+ constexpr generic_mesh_store_iterator(const generic_mesh_store_iterator&) noexcept = default;
+ constexpr generic_mesh_store_iterator(generic_mesh_store_iterator&&) noexcept = default;
+
+ constexpr generic_mesh_store_iterator& operator=(const generic_mesh_store_iterator&) noexcept = default;
+ constexpr generic_mesh_store_iterator& operator=(generic_mesh_store_iterator&&) noexcept = default;
+
+ reference operator*() const;
+
+ generic_mesh_store_iterator& operator++();
+ generic_mesh_store_iterator operator++(int);
+ generic_mesh_store_iterator& operator--();
+ generic_mesh_store_iterator operator--(int);
+
+ generic_mesh_store_iterator& operator+=(difference_type n);
+ generic_mesh_store_iterator& operator-=(difference_type n);
+ generic_mesh_store_iterator operator+(difference_type n) const;
+ generic_mesh_store_iterator operator-(difference_type n) const;
+ difference_type operator-(const generic_mesh_store_iterator& other) const;
+
+ reference operator[](difference_type n) const;
+
+ bool operator==(const generic_mesh_store_iterator& other) const;
+ bool operator!=(const generic_mesh_store_iterator& other) const;
+ bool operator<(const generic_mesh_store_iterator& other) const;
+ bool operator<=(const generic_mesh_store_iterator& other) const;
+ bool operator>(const generic_mesh_store_iterator& other) const;
+ bool operator>=(const generic_mesh_store_iterator& other) const;
+
+protected:
+ template
+ static bool is_component_enabled(component_flag_type flag);
+
+ template
+ void calc_offsets(std::index_sequence, difference_type n);
+
+ template
+ reference dereference(std::index_sequence) const;
+
+private:
+ id_iterator_type m_ids{};
+ index_iterator_type m_indices{};
+ component_iterator_type m_components{};
+ material_id_iterator_type m_material_ids{};
+ flag_count_iterator_type m_flag_counts{};
+ size_type m_index{};
+ offsets_type m_offsets{};
+};
+
+
+template
+class generic_mesh_store
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using index_type = mesh_data::index_type;
+ using component_flag_type = mesh_vertex_components::flags;
+ using material_id_type = material_store::id_type;
+
+ using iterator_type = generic_mesh_store_iterator;
+ using const_iterator = generic_mesh_store_iterator...>;
+ using view_type = std::ranges::subrange;
+ using const_view_type = std::ranges::subrange;
+ using id_type = ztu::id_type_for;
+
+ id_type add(const mesh_data& mesh);
+
+ [[nodiscard]] std::pair find(id_type id);
+
+ [[nodiscard]] std::pair find(id_type id) const;
+
+ void remove(const iterator_type& it);
+
+ void clear();
+
+ iterator_type begin();
+
+ iterator_type end();
+
+ const_iterator begin() const;
+
+ const_iterator end() const;
+
+ const_iterator cbegin() const;
+
+ const_iterator cend() const;
+
+ view_type view();
+
+ const_view_type view() const;
+
+protected:
+ std::tuple...> component_iterators();
+
+ std::tuple>...> component_iterators() const;
+
+ std::array array_counts() const;
+
+private:
+ std::vector m_ids;
+ std::vector m_indices;
+ std::tuple...> m_component_arrays;
+ std::vector> m_component_flag_counts;
+ std::vector m_material_ids;
+ id_type m_next_data_id{ 1 };
+};
+
+}
+
+
+#define INCLUDE_GENERIC_MESH_STORE_IMPLEMENTATION
+#include "assets/data_stores/generic/generic_mesh_store.ipp"
+#undef INCLUDE_GENERIC_MESH_STORE_IMPLEMENTATION
diff --git a/include/assets/data_stores/generic/generic_point_cloud_store.hpp b/include/assets/data_stores/generic/generic_point_cloud_store.hpp
new file mode 100644
index 0000000..c7fa9bf
--- /dev/null
+++ b/include/assets/data_stores/generic/generic_point_cloud_store.hpp
@@ -0,0 +1,161 @@
+#pragma once
+
+#include "util/uix.hpp"
+#include "util/id_type.hpp"
+#include "assets/components/point_cloud_vertex_components.hpp"
+#include "assets/data/point_cloud_data.hpp"
+#include "assets/data_views/point_cloud_view.hpp"
+
+namespace assets
+{
+
+template
+class generic_point_cloud_store;
+
+namespace detail
+{
+
+template
+class generic_point_cloud_store_iterator
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using component_flag_type = point_cloud_vertex_components::flags;
+ using id_type = ztu::id_type_for, ztu::u32>;
+ using value_type = std::pair;
+ using flag_count_type = std::tuple;
+
+ using id_iterator_type = id_type*;
+ using component_iterator_type = std::tuple...>;
+ using flag_count_iterator_type = const flag_count_type*;
+
+ using offsets_type = std::array;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type;
+ using iterator_category = std::random_access_iterator_tag;
+
+private:
+ friend generic_point_cloud_store;
+
+ generic_point_cloud_store_iterator(
+ id_iterator_type ids,
+ const component_iterator_type& components,
+ flag_count_iterator_type flag_counts,
+ std::size_t index,
+ const offsets_type& offsets
+ );
+
+public:
+ constexpr generic_point_cloud_store_iterator() noexcept = default;
+
+ constexpr generic_point_cloud_store_iterator(const generic_point_cloud_store_iterator&) noexcept = default;
+ constexpr generic_point_cloud_store_iterator(generic_point_cloud_store_iterator&&) noexcept = default;
+
+ constexpr generic_point_cloud_store_iterator& operator=(const generic_point_cloud_store_iterator&) noexcept = default;
+ constexpr generic_point_cloud_store_iterator& operator=(generic_point_cloud_store_iterator&&) noexcept = default;
+
+ reference operator*() const;
+
+ generic_point_cloud_store_iterator& operator++();
+ generic_point_cloud_store_iterator operator++(int);
+ generic_point_cloud_store_iterator& operator--();
+ generic_point_cloud_store_iterator operator--(int);
+
+ generic_point_cloud_store_iterator& operator+=(difference_type n);
+ generic_point_cloud_store_iterator& operator-=(difference_type n);
+ generic_point_cloud_store_iterator operator+(difference_type n) const;
+ generic_point_cloud_store_iterator operator-(difference_type n) const;
+ difference_type operator-(const generic_point_cloud_store_iterator& other) const;
+
+ reference operator[](difference_type n) const;
+
+ bool operator==(const generic_point_cloud_store_iterator& other) const;
+ bool operator!=(const generic_point_cloud_store_iterator& other) const;
+ bool operator<(const generic_point_cloud_store_iterator& other) const;
+ bool operator<=(const generic_point_cloud_store_iterator& other) const;
+ bool operator>(const generic_point_cloud_store_iterator& other) const;
+ bool operator>=(const generic_point_cloud_store_iterator& other) const;
+
+protected:
+ template
+ static bool is_component_enabled(component_flag_type flag);
+
+ template
+ void calc_offsets(std::index_sequence, difference_type n);
+
+ template
+ reference dereference(std::index_sequence) const;
+
+private:
+ id_iterator_type m_ids{};
+ component_iterator_type m_components{};
+ flag_count_iterator_type m_flag_counts{};
+ size_type m_index{};
+ offsets_type m_offsets{};
+};
+
+
+template
+class generic_point_cloud_store
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+ using component_flag_type = point_cloud_vertex_components::flags;
+
+ using iterator_type = generic_point_cloud_store_iterator;
+ using const_iterator = generic_point_cloud_store_iterator...>;
+ using view_type = std::ranges::subrange;
+ using const_view_type = std::ranges::subrange;
+ using id_type = ztu::id_type_for;
+
+ id_type add(const point_cloud_data& point_cloud);
+
+ [[nodiscard]] std::pair find(id_type id);
+
+ [[nodiscard]] std::pair find(id_type id) const;
+
+ void remove(const iterator_type& it);
+
+ void clear();
+
+ iterator_type begin();
+
+ iterator_type end();
+
+ const_iterator begin() const;
+
+ const_iterator end() const;
+
+ const_iterator cbegin() const;
+
+ const_iterator cend() const;
+
+ view_type view();
+
+ const_view_type view() const;
+
+protected:
+ std::tuple...> component_iterators();
+
+ std::tuple>...> component_iterators() const;
+
+ std::array array_counts() const;
+
+private:
+ std::vector m_ids;
+ std::tuple...> m_component_arrays;
+ std::vector> m_component_flag_counts;
+ id_type m_next_data_id{ 1 };
+};
+
+}
+
+}
+
+
+#define INCLUDE_GENERIC_POINT_CLOUD_STORE_IMPLEMENTATION
+#include "assets/data_stores/generic/generic_point_cloud_store.ipp"
+#undef INCLUDE_GENERIC_POINT_CLOUD_STORE_IMPLEMENTATION
diff --git a/include/assets/data_stores/material_library_store.hpp b/include/assets/data_stores/material_library_store.hpp
new file mode 100644
index 0000000..7886024
--- /dev/null
+++ b/include/assets/data_stores/material_library_store.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "generic/generic_basic_store.hpp"
+#include "assets/data/material_library_data.hpp"
+
+namespace assets
+{
+
+using material_library_store = generic_basic_store;
+
+}
diff --git a/include/assets/data_stores/material_store.hpp b/include/assets/data_stores/material_store.hpp
new file mode 100644
index 0000000..18d7fe7
--- /dev/null
+++ b/include/assets/data_stores/material_store.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "generic/generic_material_store.hpp"
+
+namespace assets
+{
+
+using material_store = detail::generic_material_store<
+ material_components::surface_properties,
+ material_components::transparency,
+ texture_store::id_type,
+ texture_store::id_type,
+ texture_store::id_type,
+ texture_store::id_type,
+ texture_store::id_type,
+ texture_store::id_type
+>;
+
+}
diff --git a/include/assets/data_stores/mesh_store.hpp b/include/assets/data_stores/mesh_store.hpp
new file mode 100644
index 0000000..aba7524
--- /dev/null
+++ b/include/assets/data_stores/mesh_store.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "generic/generic_mesh_store.hpp"
+
+namespace assets
+{
+
+using mesh_store = detail::generic_mesh_store<
+ mesh_vertex_components::position,
+ mesh_vertex_components::normal,
+ mesh_vertex_components::tex_coord,
+ mesh_vertex_components::color,
+ mesh_vertex_components::reflectance
+>;
+
+}
diff --git a/include/assets/data_stores/point_cloud_store.hpp b/include/assets/data_stores/point_cloud_store.hpp
new file mode 100644
index 0000000..6b76a80
--- /dev/null
+++ b/include/assets/data_stores/point_cloud_store.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#pragma once
+
+#include "generic/generic_point_cloud_store.hpp"
+
+namespace assets
+{
+
+using point_cloud_store = detail::generic_point_cloud_store<
+ point_cloud_vertex_components::position,
+ point_cloud_vertex_components::normal,
+ point_cloud_vertex_components::color,
+ point_cloud_vertex_components::reflectance
+>;
+
+}
diff --git a/include/assets/data_stores/pose_store.hpp b/include/assets/data_stores/pose_store.hpp
new file mode 100644
index 0000000..804db17
--- /dev/null
+++ b/include/assets/data_stores/pose_store.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "generic/generic_basic_store.hpp"
+#include "assets/data/pose_data.hpp"
+
+namespace assets
+{
+
+using pose_store = generic_basic_store;
+
+}
diff --git a/include/assets/data_stores/shader_source_store.hpp b/include/assets/data_stores/shader_source_store.hpp
new file mode 100644
index 0000000..a2c9735
--- /dev/null
+++ b/include/assets/data_stores/shader_source_store.hpp
@@ -0,0 +1,137 @@
+#pragma once
+
+#include "generic/generic_basic_store.hpp"
+#include "assets/data/shader_source_data.hpp"
+#include "assets/data_views/shader_source_view.hpp"
+
+namespace assets
+{
+
+class shader_source_store;
+
+template
+class shader_source_store_iterator
+{
+public:
+ using size_type = std::size_t;
+ using length_type = ztu::u32;
+ using id_type = ztu::id_type_for;
+ using value_type = std::pair;
+
+ using id_iterator_type = id_type const*;
+ using string_iterator_type = Char*;
+ using length_iterator_type = const length_type*;
+
+ using offset_type = size_type;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type;
+ using iterator_category = std::random_access_iterator_tag;
+
+private:
+ friend shader_source_store;
+
+ shader_source_store_iterator(
+ id_iterator_type ids,
+ string_iterator_type strings,
+ length_iterator_type lengths,
+ std::size_t index,
+ const offset_type& offset
+ );
+
+public:
+ constexpr shader_source_store_iterator() noexcept = default;
+
+ constexpr shader_source_store_iterator(const shader_source_store_iterator&) noexcept = default;
+ constexpr shader_source_store_iterator(shader_source_store_iterator&&) noexcept = default;
+
+ constexpr shader_source_store_iterator& operator=(const shader_source_store_iterator&) noexcept = default;
+ constexpr shader_source_store_iterator& operator=(shader_source_store_iterator&&) noexcept = default;
+
+ reference operator*() const;
+
+ shader_source_store_iterator& operator++();
+ shader_source_store_iterator operator++(int);
+ shader_source_store_iterator& operator--();
+ shader_source_store_iterator operator--(int);
+
+ shader_source_store_iterator& operator+=(difference_type n);
+ shader_source_store_iterator& operator-=(difference_type n);
+ shader_source_store_iterator operator+(difference_type n) const;
+ shader_source_store_iterator operator-(difference_type n) const;
+ difference_type operator-(const shader_source_store_iterator& other) const;
+
+ reference operator[](difference_type n) const;
+
+ bool operator==(const shader_source_store_iterator& other) const;
+ bool operator!=(const shader_source_store_iterator& other) const;
+ bool operator<(const shader_source_store_iterator& other) const;
+ bool operator<=(const shader_source_store_iterator& other) const;
+ bool operator>(const shader_source_store_iterator& other) const;
+ bool operator>=(const shader_source_store_iterator& other) const;
+
+protected:
+
+ void calc_offset(difference_type n);
+
+ reference dereference() const;
+
+private:
+ id_iterator_type m_ids{};
+ string_iterator_type m_strings{};
+ length_iterator_type m_lengths{};
+ size_type m_index{};
+ offset_type m_offset{};
+};
+
+
+class shader_source_store
+{
+public:
+ using size_type = std::size_t;
+ using count_type = ztu::u32;
+
+ using iterator_type = shader_source_store_iterator;
+ using const_iterator = shader_source_store_iterator;
+ using view_type = std::ranges::subrange;
+ using const_view_type = std::ranges::subrange;
+ using id_type = ztu::id_type_for;
+
+ inline id_type add(const shader_source_data& shader_source);
+
+ [[nodiscard]] inline std::pair find(id_type id);
+
+ [[nodiscard]] inline std::pair find(id_type id) const;
+
+ inline void remove(const iterator_type& it);
+
+ inline void clear();
+
+ [[nodiscard]] inline iterator_type begin();
+
+ [[nodiscard]] inline iterator_type end();
+
+ [[nodiscard]] inline const_iterator begin() const;
+
+ [[nodiscard]] inline const_iterator end() const;
+
+ [[nodiscard]] inline const_iterator cbegin() const;
+
+ [[nodiscard]] inline const_iterator cend() const;
+
+ [[nodiscard]] inline view_type view();
+
+ [[nodiscard]] inline const_view_type view() const;
+
+private:
+ std::vector m_ids;
+ std::vector m_strings;
+ std::vector m_lengths;
+ id_type m_next_data_id{ 1 };
+};
+
+}
+
+#define INCLUDE_SHADER_SOURCE_STORE_IMPLEMENTATION
+#include "assets/data_stores/shader_source_store.ipp"
+#undef INCLUDE_SHADER_SOURCE_STORE_IMPLEMENTATION
diff --git a/include/assets/data_stores/texture_store.hpp b/include/assets/data_stores/texture_store.hpp
new file mode 100644
index 0000000..f29dc9f
--- /dev/null
+++ b/include/assets/data_stores/texture_store.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+#include "generic/generic_basic_store.hpp"
+#include "assets/data/texture_data.hpp"
+
+namespace assets
+{
+
+using texture_store = generic_basic_store;
+
+}
+
diff --git a/include/assets/data_views/material_view.hpp b/include/assets/data_views/material_view.hpp
new file mode 100644
index 0000000..0f9361d
--- /dev/null
+++ b/include/assets/data_views/material_view.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "assets/data/material_data.hpp"
+
+namespace assets
+{
+
+using material_view = material_data;
+
+}
\ No newline at end of file
diff --git a/include/assets/data_views/mesh_view.hpp b/include/assets/data_views/mesh_view.hpp
new file mode 100644
index 0000000..6210315
--- /dev/null
+++ b/include/assets/data_views/mesh_view.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include
+#include
+
+#include "assets/components/mesh_vertex_components.hpp"
+#include "assets/data/mesh_data.hpp"
+#include "assets/data_stores/material_store.hpp"
+
+namespace assets
+{
+
+namespace detail
+{
+template
+struct generic_mesh_view
+{
+ mesh_vertex_components::flags component_flags;
+ std::span indices;
+ std::tuple...> vertex_component_arrays;
+ material_store::id_type material_id;
+};
+
+}
+
+using mesh_view = detail::generic_mesh_view<
+ mesh_vertex_components::position,
+ mesh_vertex_components::normal,
+ mesh_vertex_components::tex_coord,
+ mesh_vertex_components::color,
+ mesh_vertex_components::reflectance
+>;
+}
\ No newline at end of file
diff --git a/include/assets/data_views/point_cloud_view.hpp b/include/assets/data_views/point_cloud_view.hpp
new file mode 100644
index 0000000..3af6fc8
--- /dev/null
+++ b/include/assets/data_views/point_cloud_view.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include
+#include
+
+#include "assets/components/point_cloud_vertex_components.hpp"
+
+namespace assets
+{
+
+namespace detail
+{
+template
+struct generic_point_cloud_view
+{
+ point_cloud_vertex_components::flags vertex_components;
+ std::tuple...> vertex_component_arrays;
+};
+}
+
+using point_cloud_view = detail::generic_point_cloud_view<
+ point_cloud_vertex_components::position,
+ point_cloud_vertex_components::normal,
+ point_cloud_vertex_components::color,
+ point_cloud_vertex_components::reflectance
+>;
+
+}
\ No newline at end of file
diff --git a/include/assets/data_views/shader_source_view.hpp b/include/assets/data_views/shader_source_view.hpp
new file mode 100644
index 0000000..7c4f1a1
--- /dev/null
+++ b/include/assets/data_views/shader_source_view.hpp
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+using shader_source_view = std::string_view;
diff --git a/include/assets/data_views/texture_view.hpp b/include/assets/data_views/texture_view.hpp
new file mode 100644
index 0000000..da644bf
--- /dev/null
+++ b/include/assets/data_views/texture_view.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "assets/data/material_data.hpp"
+
+namespace assets
+{
+
+struct texture_view
+{
+ std::weak_ptr data;
+ int width, height;
+ texture_components::flags component_flags;
+};
+
+}
\ No newline at end of file
diff --git a/include/assets/dynamic_data_store.hpp b/include/assets/dynamic_data_store.hpp
index 8c138b9..79e7e47 100644
--- a/include/assets/dynamic_data_store.hpp
+++ b/include/assets/dynamic_data_store.hpp
@@ -1,21 +1,25 @@
#pragma once
-#include "dynamic_data_stores/dynamic_material_library_store.hpp"
-#include "dynamic_data_stores/dynamic_material_store.hpp"
-#include "dynamic_data_stores/dynamic_mesh_store.hpp"
-#include "dynamic_data_stores/dynamic_point_cloud_store.hpp"
-#include "dynamic_data_stores/dynamic_pose_store.hpp"
-#include "dynamic_data_stores/dynamic_shader_source_store.hpp"
-#include "dynamic_data_stores/dynamic_texture_store.hpp"
+#include "data_stores/material_library_store.hpp"
+#include "data_stores/material_store.hpp"
+#include "data_stores/mesh_store.hpp"
+#include "data_stores/point_cloud_store.hpp"
+#include "data_stores/pose_store.hpp"
+#include "data_stores/shader_source_store.hpp"
+#include "data_stores/texture_store.hpp"
+
+namespace assets
+{
struct dynamic_data_store
{
- dynamic_material_library_store material_libraries;
- dynamic_material_store materials;
- dynamic_mesh_store meshes;
- dynamic_point_cloud_store point_clouds;
- dynamic_pose_store poses;
- dynamic_shader_store shaders;
- dynamic_texture_store textures;
+ material_library_store material_libraries;
+ material_store materials;
+ mesh_store meshes;
+ point_cloud_store point_clouds;
+ pose_store poses;
+ shader_source_store shader_sources;
+ texture_store textures;
};
+}
diff --git a/include/assets/dynamic_data_stores/dynamic_material_library_store.hpp b/include/assets/dynamic_data_stores/dynamic_material_library_store.hpp
deleted file mode 100644
index a180507..0000000
--- a/include/assets/dynamic_data_stores/dynamic_material_library_store.hpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-#include "generic/generic_dynamic_store.hpp"
-#include "assets/dynamic_read_buffers/dynamic_material_library_buffer.hpp"
-
-using dynamic_material_library_store = generic_dynamic_store;
diff --git a/include/assets/dynamic_data_stores/dynamic_material_store.hpp b/include/assets/dynamic_data_stores/dynamic_material_store.hpp
deleted file mode 100644
index cfb849f..0000000
--- a/include/assets/dynamic_data_stores/dynamic_material_store.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include "dynamic_texture_store.hpp"
-#include "generic/generic_dynamic_component_store.hpp"
-#include "assets/dynamic_read_buffers/dynamic_material_buffer.hpp"
-
-class dynamic_material_store {
- using store_type = generic_dynamic_component_store<
- components::material::flags,
- components::material::surface_properties,
- components::material::transparency,
- dynamic_texture_store::id_type,
- dynamic_texture_store::id_type,
- dynamic_texture_store::id_type,
- dynamic_texture_store::id_type,
- dynamic_texture_store::id_type,
- dynamic_texture_store::id_type
- >;
-
-public:
- using id_type = store_type::id_type;
- using iterator_type = store_type::iterator_type;
- using const_iterator = store_type::const_iterator;
-
- id_type add(const dynamic_material_buffer& data);
-
- [[nodiscard]] std::pair find(id_type id);
-
- [[nodiscard]] std::pair find(id_type id) const;
-
- void remove(const iterator_type& it);
-
- void clear();
-
-private:
- store_type m_store;
-};
diff --git a/include/assets/dynamic_data_stores/dynamic_mesh_store.hpp b/include/assets/dynamic_data_stores/dynamic_mesh_store.hpp
deleted file mode 100644
index 2268d97..0000000
--- a/include/assets/dynamic_data_stores/dynamic_mesh_store.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include "assets/dynamic_data_stores/generic/generic_dynamic_indexed_component_array_store.hpp"
-
-#include "assets/components/mesh_vertex_components.hpp"
-#include "assets/dynamic_read_buffers/dynamic_mesh_buffer.hpp"
-
-class dynamic_mesh_store
-{
- using store_type = generic_dynamic_indexed_component_array_store<
- components::mesh_vertex::flags,
- ztu::u32,
- components::mesh_vertex::position,
- components::mesh_vertex::normal,
- components::mesh_vertex::tex_coord,
- components::mesh_vertex::color,
- components::mesh_vertex::reflectance
- >;
-
-public:
- using id_type = store_type::id_type;
- using iterator_type = store_type::iterator_type;
- using const_iterator = store_type::const_iterator;
-
- id_type add(const dynamic_mesh_buffer& mesh_buffer);
-
- [[nodiscard]] std::pair find(id_type id);
-
- [[nodiscard]] std::pair find(id_type id) const;
-
- void remove(const iterator_type& it);
-
- void clear();
-
-private:
- store_type m_store;
-};
\ No newline at end of file
diff --git a/include/assets/dynamic_data_stores/dynamic_point_cloud_store.hpp b/include/assets/dynamic_data_stores/dynamic_point_cloud_store.hpp
deleted file mode 100644
index f86b9c2..0000000
--- a/include/assets/dynamic_data_stores/dynamic_point_cloud_store.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-#include "assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.hpp"
-
-#include "assets/components/point_cloud_vertex_components.hpp"
-#include "assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp"
-
-
-class dynamic_point_cloud_store
-{
- using store_type = generic_dynamic_component_array_store<
- components::point_cloud_vertex::flags,
- components::point_cloud_vertex::position,
- components::point_cloud_vertex::normal,
- components::point_cloud_vertex::color,
- components::point_cloud_vertex::reflectance
- >;
-
-public:
- using id_type = store_type::id_type;
- using iterator_type = store_type::iterator_type;
- using const_iterator = store_type::const_iterator;
-
- id_type add(const dynamic_point_cloud_buffer& point_cloud_buffer);
-
- [[nodiscard]] std::pair find(id_type id);
-
- [[nodiscard]] std::pair find(id_type id) const;
-
- void remove(const iterator_type& it);
-
- void clear();
-
-private:
- store_type m_store;
-};
diff --git a/include/assets/dynamic_data_stores/dynamic_pose_store.hpp b/include/assets/dynamic_data_stores/dynamic_pose_store.hpp
deleted file mode 100644
index 9c59d68..0000000
--- a/include/assets/dynamic_data_stores/dynamic_pose_store.hpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-#include "generic/generic_dynamic_store.hpp"
-#include "glm/mat4x4.hpp"
-
-using dynamic_pose_store = generic_dynamic_store;
diff --git a/include/assets/dynamic_data_stores/dynamic_shader_source_store.hpp b/include/assets/dynamic_data_stores/dynamic_shader_source_store.hpp
deleted file mode 100644
index e6a6947..0000000
--- a/include/assets/dynamic_data_stores/dynamic_shader_source_store.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-
-#include "generic/generic_dynamic_store.hpp"
-#include "assets/dynamic_read_buffers/dynamic_shader_buffer.hpp"
-
-// TODO use compressed store where all shaders are condensed into one vector
-using dynamic_shader_source_store = generic_dynamic_store;
diff --git a/include/assets/dynamic_data_stores/dynamic_texture_store.hpp b/include/assets/dynamic_data_stores/dynamic_texture_store.hpp
deleted file mode 100644
index 52437c3..0000000
--- a/include/assets/dynamic_data_stores/dynamic_texture_store.hpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-#include "generic/generic_dynamic_store.hpp"
-#include "assets/dynamic_read_buffers/dynamic_texture_buffer.hpp"
-
-using dynamic_texture_store = generic_dynamic_store;
diff --git a/include/assets/dynamic_data_stores/dynamic_vertex_store.hpp b/include/assets/dynamic_data_stores/dynamic_vertex_store.hpp
deleted file mode 100644
index 77f0e5c..0000000
--- a/include/assets/dynamic_data_stores/dynamic_vertex_store.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-#include "util/id_type.hpp"
-#include "util/uix.hpp"
-
-#include "GL/glew.h"
-
-template
-class dynamic_vertex_store {
-public:
- using id_type = ztu::id_type_for;
-
- void add(
- C component_flags,
- std::span... components
- );
-
- void build_vertex_buffer(
- std::vector& vertex_buffer,
- std::size_t& component_count,
- std::array& component_types,
- std::array& component_lengths,
- GLsizei& stride
- ) const;
-
-protected:
- std::tuple...> m_component_buffers{};
- std::vector vertex_counts;
- std::vector m_components{ 0 };
-};
-
-#define INCLUDE_DYNAMIC_MODEL_DATA_IMPLEMENTATION
-#include "assets/dynamic_read_buffers/dynamic_model_buffer.ipp"
-#undef INCLUDE_DYNAMIC_MODEL_DATA_IMPLEMENTATION
diff --git a/include/assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.hpp b/include/assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.hpp
deleted file mode 100644
index 94dec73..0000000
--- a/include/assets/dynamic_data_stores/generic/generic_dynamic_component_array_store.hpp
+++ /dev/null
@@ -1,149 +0,0 @@
-#pragma once
-
-#include
-#include
-
-#include "util/uix.hpp"
-#include "util/id_type.hpp"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-template
-class generic_dynamic_component_array_store;
-
-template
-class component_array_iterator {
-public:
- using value_type = std::tuple...>;
- using size_type = std::size_t;
- using count_type = ztu::u32;
- using flag_count_type = std::pair;
- using component_array_pointer_type = std::tuple...>;
- using flag_count_pointer_type = const flag_count_type*;
- using offsets_type = std::array;
- using difference_type = std::ptrdiff_t;
- using pointer = value_type*;
- using reference = value_type;
- using iterator_category = std::random_access_iterator_tag;
-
-private:
- friend generic_dynamic_component_array_store;
-
- component_array_iterator(
- component_array_pointer_type components,
- flag_count_pointer_type flags,
- std::size_t index,
- const offsets_type& offsets
- );
-
-public:
- constexpr component_array_iterator() noexcept = default;
-
- constexpr component_array_iterator(const component_array_iterator&) noexcept = default;
- constexpr component_array_iterator(component_array_iterator&&) noexcept = default;
-
- constexpr component_array_iterator& operator=(const component_array_iterator&) noexcept = default;
- constexpr component_array_iterator& operator=(component_array_iterator&&) noexcept = default;
-
- reference operator*() const;
-
- component_array_iterator& operator++();
- component_array_iterator operator++(int);
- component_array_iterator& operator--();
- component_array_iterator operator--(int);
-
- component_array_iterator& operator+=(difference_type n);
- component_array_iterator& operator-=(difference_type n);
- component_array_iterator operator+(difference_type n) const;
- component_array_iterator operator-(difference_type n) const;
- difference_type operator-(const component_array_iterator& other) const;
-
- reference operator[](difference_type n) const;
-
- bool operator==(const component_array_iterator& other) const;
- bool operator!=(const component_array_iterator& other) const;
- bool operator<(const component_array_iterator& other) const;
- bool operator<=(const component_array_iterator& other) const;
- bool operator>(const component_array_iterator& other) const;
- bool operator>=(const component_array_iterator& other) const;
-
-protected:
- template
- static bool is_component_enabled(C flag);
-
- template
- void calc_offsets(std::index_sequence, difference_type n);
-
- template
- reference dereference(std::index_sequence) const;
-
- template
- std::tuple_element_t get_span() const;
-
-private:
- value_type m_components{};
- const flag_count_type* m_flag_counts{};
- size_type m_index{};
- offsets_type m_offsets{};
-};
-
-template
-class generic_dynamic_component_array_store
-{
-public:
- using id_type = ztu::id_type_for;
- using count_type = ztu::u32;
- using iterator_type = component_array_iterator;
- using const_iterator = component_array_iterator...>;
- using view_type = std::ranges::subrange