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,85 @@
#pragma once
#include "assets/components/mesh_vertex_components.hpp"
#include "assets/components/point_cloud_vertex_components.hpp"
#include "assets/components/material_components.hpp"
#include "shader_program/attributes/mesh_attributes.hpp"
#include "shader_program/uniforms/mesh_uniforms.hpp"
namespace shader_program::capabilities::mesh
{
struct type
{
attributes::mesh::flags attributes{
attributes::mesh::flags::none
};
uniforms::mesh::flags uniforms{
uniforms::mesh::flags::none
};
};
namespace indices
{
using type = ztu::u8;
constexpr inline type position = 0;
constexpr inline type lit = 1;
constexpr inline type textured = 2;
constexpr inline type uniform_color = 3;
constexpr inline type uniform_alpha = 4;
constexpr inline type point = 5;
}
enum class flags : int
{
none = 0,
position = 1 << indices::position,
lit = 1 << indices::lit,
textured = 1 << indices::textured,
uniform_color = 1 << indices::uniform_color,
uniform_alpha = 1 << indices::uniform_alpha,
point = 1 << indices::point
};
constexpr inline auto position = type{
.attributes = attributes::mesh::flags::position,
.uniforms = uniforms::mesh::flags::mvp
};
constexpr inline auto lit = type{
.attributes = attributes::mesh::flags::normal,
.uniforms = (
uniforms::mesh::flags::model_matrix |
uniforms::mesh::flags::view_pos |
uniforms::mesh::flags::point_light_direction |
uniforms::mesh::flags::point_light_color |
uniforms::mesh::flags::ambient_light_color |
uniforms::mesh::flags::ambient_filter |
uniforms::mesh::flags::diffuse_filter |
uniforms::mesh::flags::specular_filter |
uniforms::mesh::flags::shininess
)
};
constexpr inline auto point = type{
.uniforms = uniforms::mesh::flags::point_size
};
constexpr inline auto textured = type{
.attributes = attributes::mesh::flags::tex_coord,
.uniforms = uniforms::mesh::flags::tex
};
constexpr inline auto uniform_color = type{
.uniforms = uniforms::mesh::flags::color
};
constexpr inline auto uniform_alpha = type{
.uniforms = uniforms::mesh::flags::alpha
};
constexpr inline auto all = std::array{
position, lit, textured, uniform_color, uniform_alpha, point
};
}

View File

@@ -0,0 +1,77 @@
#pragma once
#include "shader_program/attributes/point_cloud_attributes.hpp"
#include "shader_program/uniforms/point_cloud_uniforms.hpp"
#include "assets/components/mesh_vertex_components.hpp"
#include "assets/components/point_cloud_vertex_components.hpp"
#include <array>
namespace shader_program::capabilities::point_cloud
{
struct type
{
attributes::point_cloud::flags attributes{
attributes::point_cloud::flags::none
};
uniforms::point_cloud::flags uniforms{
uniforms::point_cloud::flags::none
};
};
namespace indices
{
using type = ztu::u8;
constexpr inline type position = 0;
constexpr inline type vertex_color = 1;
constexpr inline type uniform_color = 2;
constexpr inline type normal = 3;
constexpr inline type reflectance = 4;
constexpr inline type rainbow = 5;
}
enum class flags : int
{
none = 0,
position = 1 << indices::position,
vertex_color = 1 << indices::vertex_color,
uniform_color = 1 << indices::uniform_color,
normal = 1 << indices::normal,
reflectance = 1 << indices::reflectance,
rainbow = 1 << indices::rainbow
};
constexpr inline auto position = type{
.attributes = attributes::point_cloud::flags::position,
.uniforms = uniforms::point_cloud::flags::mvp
};
constexpr inline auto rainbow = type{};
constexpr inline auto vertex_color = type{
.attributes = attributes::point_cloud::flags::color
};
constexpr inline auto uniform_color = type{
.uniforms = uniforms::point_cloud::flags::color
};
constexpr inline auto normal = type{
.attributes = attributes::point_cloud::flags::normal,
.uniforms = (
uniforms::point_cloud::flags::model |
uniforms::point_cloud::flags::camera_position
)
};
constexpr inline auto reflectance = type{
.attributes = attributes::point_cloud::flags::reflectance
};
constexpr inline auto all = std::array{
position, vertex_color, uniform_color, normal, reflectance, rainbow
};
}