This commit is contained in:
ZY4N
2025-03-28 13:09:34 +01:00
parent 6f60cc11c8
commit d18b40a7fc
34 changed files with 393 additions and 272 deletions

View File

@@ -0,0 +1,23 @@
#pragma once
#include "config/primitives.hpp"
#include "assets/components/mesh_vertex_components.hpp"
#include "assets/data_stores/material_store.hpp"
namespace assets::detail
{
template<typename T>
struct generic_mesh_view {};
template<typename... Ts>
struct generic_mesh_view<z3d::structure<Ts...>>
{
mesh_vertex_components::flags component_flags;
z3d::array_view<z3d::index_triangle> triangles;
z3d::structure<z3d::array_view<Ts>...> vertex_component_arrays;
z3d::vertex_index vertex_count;
material_store::id_type material_id;
};
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include "config/primitives.hpp"
#include "assets/components/point_cloud_vertex_components.hpp"
namespace assets::detail
{
template<typename... Ts>
struct generic_point_cloud_view
{
point_cloud_vertex_components::flags vertex_component_flags;
z3d::structure<z3d::array_view<Ts>...> vertex_component_arrays;
z3d::vertex_index point_count;
};
}

View File

@@ -1,34 +1,12 @@
#pragma once
#include <span>
#include <tuple>
#include "assets/components/mesh_vertex_components.hpp"
#include "assets/data/mesh_data.hpp"
#include "assets/data_stores/material_store.hpp"
#include "generic/generic_mesh_view.hpp"
namespace assets
{
namespace detail
{
template<typename... Ts>
struct generic_mesh_view
{
mesh_vertex_components::flags component_flags;
std::span<mesh_data::index_type> indices;
std::tuple<std::span<Ts>...> vertex_component_arrays;
std::size_t vertex_count;
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
mesh_vertex_components::all
>;
}

View File

@@ -1,29 +1,12 @@
#pragma once
#include <span>
#include <tuple>
#include "assets/components/point_cloud_vertex_components.hpp"
#include "generic/generic_point_cloud_viwe.hpp"
namespace assets
{
namespace detail
{
template<typename... Ts>
struct generic_point_cloud_view
{
point_cloud_vertex_components::flags vertex_component_flags;
std::tuple<std::span<Ts>...> vertex_component_arrays;
std::size_t point_count;
};
}
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
point_cloud_vertex_components::all
>;
}

View File

@@ -1,5 +1,5 @@
#pragma once
#include <string_view>
#include "config/primitives.hpp"
using shader_source_view = std::string_view;
using shader_source_view = z3d::string_view;

View File

@@ -1,14 +1,15 @@
#pragma once
#include "assets/data/material_data.hpp"
#include "assets/components/texture_components.hpp"
#include <memory>
namespace assets
{
struct texture_view
{
std::weak_ptr<std::uint8_t[]> data;
int width, height;
std::weak_ptr<z3d::u8[]> data;
z3d::i32 width, height;
texture_components::flags component_flags;
};