Further shader compilation development.
This commit is contained in:
101
include/opengl/shading/features/point_cloud_features.hpp
Normal file
101
include/opengl/shading/features/point_cloud_features.hpp
Normal file
@@ -0,0 +1,101 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shading/attributes/point_cloud_attributes.hpp"
|
||||
#include "opengl/shading/uniforms/point_cloud_uniforms.hpp"
|
||||
|
||||
#include "assets/components/mesh_vertex_components.hpp"
|
||||
#include "assets/components/point_cloud_vertex_components.hpp"
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace zgl::shading::features::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 square = 0;
|
||||
constexpr inline type lighting = 1;
|
||||
constexpr inline type luminance = 2;
|
||||
constexpr inline type color = 3;
|
||||
constexpr inline type alpha = 4;
|
||||
constexpr inline type uniform_color = 5;
|
||||
constexpr inline type rainbow = 6;
|
||||
}
|
||||
|
||||
enum class flags : std::uint8_t
|
||||
{
|
||||
none = 0,
|
||||
square = 1 << indices::square,
|
||||
lighting = 1 << indices::lighting,
|
||||
luminance = 1 << indices::luminance,
|
||||
color = 1 << indices::color,
|
||||
alpha = 1 << indices::alpha,
|
||||
uniform_color = 1 << indices::uniform_color,
|
||||
rainbow = 1 << indices::rainbow
|
||||
};
|
||||
|
||||
constexpr inline auto square = type{
|
||||
.attributes = attributes::point_cloud::flags::position,
|
||||
.uniforms = (
|
||||
uniforms::point_cloud::flags::mvp_matrix |
|
||||
uniforms::point_cloud::flags::point_size
|
||||
)
|
||||
};
|
||||
|
||||
constexpr inline auto lighting = type{
|
||||
.attributes = attributes::point_cloud::flags::normal,
|
||||
.uniforms = (
|
||||
uniforms::point_cloud::flags::model_matrix |
|
||||
uniforms::point_cloud::flags::camera_position
|
||||
)
|
||||
};
|
||||
|
||||
constexpr inline auto luminance = type{
|
||||
.attributes = attributes::point_cloud::flags::luminance
|
||||
};
|
||||
|
||||
constexpr inline auto color = type{
|
||||
.attributes = attributes::point_cloud::flags::color
|
||||
};
|
||||
|
||||
constexpr inline auto alpha = type{
|
||||
.attributes = attributes::point_cloud::flags::alpha
|
||||
};
|
||||
|
||||
constexpr inline auto uniform_color = type{
|
||||
.uniforms = uniforms::point_cloud::flags::color
|
||||
};
|
||||
|
||||
constexpr inline auto rainbow = type{
|
||||
.uniforms = (
|
||||
uniforms::point_cloud::flags::rainbow_offset_y |
|
||||
uniforms::point_cloud::flags::rainbow_scale_y
|
||||
)
|
||||
};
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
square, lighting, luminance, color, alpha, uniform_color, rainbow
|
||||
};
|
||||
|
||||
constexpr inline auto names = std::array{
|
||||
"square",
|
||||
"lighting",
|
||||
"luminance",
|
||||
"color",
|
||||
"alpha",
|
||||
"uniform_color",
|
||||
"rainbow"
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user