This commit is contained in:
ZY4N
2024-12-22 16:58:40 +01:00
parent 2704814de2
commit db8db8f9d7
161 changed files with 17102 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
#pragma once
#include <tuple>
#include "../dynamic_read_buffers"
#include "assets/data/surface_properties.hpp"
#include "util/enum_operators.hpp"
namespace components::material
{
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;
namespace indices
{
using type = std::size_t;
inline constexpr type surface_properties = 0;
inline constexpr type transparency = 1;
inline constexpr type ambient_color_texture = 2;
inline constexpr type diffuse_color_texture = 3;
inline constexpr type specular_color_texture = 4;
inline constexpr type shininess_texture = 5;
inline constexpr type alpha_texture = 6;
inline constexpr type bump_texture = 7;
}
enum class flags : std::uint8_t
{
none = 0,
surface_properties = 1 << indices::surface_properties,
transparency = 1 << indices::transparency,
ambient_filter_texture = 1 << indices::ambient_color_texture,
diffuse_filter_texture = 1 << indices::diffuse_color_texture,
specular_filter_texture = 1 << indices::specular_color_texture,
shininess_texture = 1 << indices::shininess_texture,
alpha_texture = 1 << indices::alpha_texture,
bump_texture = 1 << indices::bump_texture
};
using all = std::tuple<
surface_properties,
transparency,
ambient_color_texture,
diffuse_color_texture,
specular_color_texture,
shininess_texture,
alpha_texture,
bump_texture
>;
constexpr inline auto count = std::tuple_size_v<all>;
} // namespace material_component
DEFINE_ENUM_FLAG_OPERATORS(components::material::flags)

View File

@@ -0,0 +1,39 @@
#pragma once
#include <array>
#include <tuple>
#include "util/enum_operators.hpp"
namespace components::mesh_vertex {
using position = std::array<float, 3>;
using normal = std::array<float, 3>;
using tex_coord = std::array<float, 2>;
using color = std::array<float, 3>;
using reflectance = std::array<float, 1>;
namespace indices
{
using type = std::size_t;
inline constexpr type position = 0;
inline constexpr type normal = 1;
inline constexpr type tex_coord = 2;
inline constexpr type color = 3;
inline constexpr type reflectance = 4;
}
enum class flags : std::uint8_t {
none = 0,
position = 1 << indices::position,
normal = 1 << indices::normal,
tex_coord = 1 << indices::tex_coord,
color = 1 << indices::color,
reflectance = 1 << indices::reflectance
};
using all = std::tuple<position, normal, tex_coord, color, reflectance>;
constexpr inline auto count = std::tuple_size_v<all>;
} // namespace components::mesh_vertex
DEFINE_ENUM_FLAG_OPERATORS(components::mesh_vertex::flags)

View File

@@ -0,0 +1,36 @@
#pragma once
#include <array>
#include <tuple>
#include "util/enum_operators.hpp"
namespace components::point_cloud_vertex {
using position = std::array<float, 3>;
using normal = std::array<float, 3>;
using color = std::array<float, 3>;
using reflectance = std::array<float, 1>;
namespace indices
{
using type = std::size_t;
inline constexpr type position = 0;
inline constexpr type normal = 1;
inline constexpr type color = 2;
inline constexpr type reflectance = 3;
} // namespace indices
enum class flags : std::uint8_t {
none = 0,
position = 1 << indices::position,
normal = 1 << indices::normal,
color = 1 << indices::color,
reflectance = 1 << indices::reflectance
};
using all = std::tuple<position, normal, color, reflectance>;
constexpr inline auto count = std::tuple_size_v<all>;
} // namespace components::point_cloud_vertex
DEFINE_ENUM_FLAG_OPERATORS(components::point_cloud_vertex::flags)

View File

@@ -0,0 +1,28 @@
#pragma once
#include <tuple>
#include <cinttypes>
#include "util/enum_operators.hpp"
namespace components::texture {
using red = std::uint8_t;
using green = std::uint8_t;
using blue = std::uint8_t;
using luminance = std::uint8_t;
enum class flags : std::uint8_t {
none = 0,
luminance = 1 << 1,
red = 1 << 2,
green = 1 << 3,
blue = 1 << 4,
alpha = 1 << 5
};
using all = std::tuple<red, green, blue, luminance>;
constexpr inline auto count = std::tuple_size_v<all>;
} // namespace components::texture
DEFINE_ENUM_FLAG_OPERATORS(components::texture::flags)