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,127 @@
#pragma once
#include "assets/components/material_components.hpp"
#include "assets/components/mesh_vertex_components.hpp"
#include "shader_program/capabilities/mesh_capabilities.hpp"
#include <array>
namespace rendering::requirements::mesh
{
struct type
{
shader_program::capabilities::mesh::indices::type shader_program_requirement_index{};
components::mesh_vertex::flags vertex_requirements{
components::mesh_vertex::flags::none
};
material_component::flags material_requirements{
material_component::flags::none
};
};
enum class flags : int
{
none = 0,
position = 1 << 0,
lit = 1 << 1,
textured = 1 << 2,
uniform_color = 1 << 3,
uniform_alpha = 1 << 4,
point = 1 << 5
};
constexpr inline auto position = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::position,
.vertex_requirements = components::mesh_vertex::flags::position
};
constexpr inline auto lit = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::lit,
.vertex_requirements = components::mesh_vertex::flags::normal,
.material_requirements = material_component::flags::surface_properties
};
constexpr inline auto point = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::point
};
constexpr inline auto textured = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::textured,
.vertex_requirements = components::mesh_vertex::flags::tex_coord,
.material_requirements = material_component::flags::texture,
};
constexpr inline auto uniform_color = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::uniform_color
};
constexpr inline auto uniform_alpha = type{
.shader_program_requirement_index = shader_program::capabilities::mesh::indices::uniform_alpha,
.material_requirements = material_component::flags::transparency
};
constexpr inline auto all = std::array{
position, lit, textured, uniform_color, uniform_alpha, point
};
}
[[nodiscard]] constexpr rendering::requirements::mesh::flags operator|(
const rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b
) {
return static_cast<rendering::requirements::mesh::flags>(static_cast<int>(a) | static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::mesh::flags operator&(
const rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b
) {
return static_cast<rendering::requirements::mesh::flags>(static_cast<int>(a) & static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::mesh::flags operator^(
const rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b
) {
return static_cast<rendering::requirements::mesh::flags>(static_cast<int>(a) ^ static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::mesh::flags operator~(const rendering::requirements::mesh::flags& a) {
return static_cast<rendering::requirements::mesh::flags>(~static_cast<int>(a));
}
constexpr rendering::requirements::mesh::flags& operator|=(rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b) {
return a = a | b;
}
constexpr rendering::requirements::mesh::flags& operator&=(rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b) {
return a = a & b;
}
constexpr rendering::requirements::mesh::flags& operator^=(rendering::requirements::mesh::flags& a, const rendering::requirements::mesh::flags& b) {
return a = a ^ b;
}
[[nodiscard]] constexpr bool operator<(
rendering::requirements::mesh::flags lhs, rendering::requirements::mesh::flags rhs
) {
return static_cast<int>(lhs) < static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator<=(
rendering::requirements::mesh::flags lhs, rendering::requirements::mesh::flags rhs
) {
return static_cast<int>(lhs) <= static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator>(
rendering::requirements::mesh::flags lhs, rendering::requirements::mesh::flags rhs
) {
return static_cast<int>(lhs) > static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator>=(
rendering::requirements::mesh::flags lhs, rendering::requirements::mesh::flags rhs
) {
return static_cast<int>(lhs) >= static_cast<int>(rhs);
}

View File

@@ -0,0 +1,122 @@
#pragma once
#include "assets/components/point_cloud_vertex_components.hpp"
#include "shader_program/capabilities/point_cloud_capabilities.hpp"
#include <array>
namespace rendering::requirements::point_cloud
{
struct type
{
shader_program::capabilities::point_cloud::indices::type shader_program_requirement_index{};
components::point_cloud_vertex::flags vertex_requirements{
components::point_cloud_vertex::flags::none
};
};
enum class flags : int
{
none = 0,
position = 1 << 0,
vertex_color = 1 << 1,
uniform_color = 1 << 2,
normal = 1 << 3,
reflectance = 1 << 4,
rainbow = 1 << 5
};
constexpr inline auto position = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::position,
.vertex_requirements = components::point_cloud_vertex::flags::position
};
constexpr inline auto rainbow = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::rainbow
};
constexpr inline auto vertex_color = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::vertex_color,
.vertex_requirements = components::point_cloud_vertex::flags::color
};
constexpr inline auto uniform_color = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::uniform_color
};
constexpr inline auto normal = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::normal,
.vertex_requirements = components::point_cloud_vertex::flags::normal
};
constexpr inline auto reflectance = type{
.shader_program_requirement_index = shader_program::capabilities::point_cloud::indices::reflectance,
.vertex_requirements = components::point_cloud_vertex::flags::reflectance
};
constexpr inline auto all = std::array{
position, vertex_color, uniform_color, normal, reflectance, rainbow
};
}
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator|(
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
) {
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) | static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator&(
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
) {
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) & static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator^(
const rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b
) {
return static_cast<rendering::requirements::point_cloud::flags>(static_cast<int>(a) ^ static_cast<int>(b));
}
[[nodiscard]] constexpr rendering::requirements::point_cloud::flags operator~(const rendering::requirements::point_cloud::flags& a) {
return static_cast<rendering::requirements::point_cloud::flags>(~static_cast<int>(a));
}
constexpr rendering::requirements::point_cloud::flags& operator|=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
return a = a | b;
}
constexpr rendering::requirements::point_cloud::flags& operator&=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
return a = a & b;
}
constexpr rendering::requirements::point_cloud::flags& operator^=(rendering::requirements::point_cloud::flags& a, const rendering::requirements::point_cloud::flags& b) {
return a = a ^ b;
}
[[nodiscard]] constexpr bool operator<(
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
) {
return static_cast<int>(lhs) < static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator<=(
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
) {
return static_cast<int>(lhs) <= static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator>(
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
) {
return static_cast<int>(lhs) > static_cast<int>(rhs);
}
[[nodiscard]] constexpr bool operator>=(
rendering::requirements::point_cloud::flags lhs, rendering::requirements::point_cloud::flags rhs
) {
return static_cast<int>(lhs) >= static_cast<int>(rhs);
}