43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "opengl/shader_program_variable.hpp"
|
|
#include <array>
|
|
#include "util/enum_bitfield_operators.hpp"
|
|
#include <string_view>
|
|
|
|
namespace zgl::shading::attributes::point_cloud
|
|
{
|
|
|
|
enum class flags : std::uint8_t
|
|
{
|
|
none = 0,
|
|
position = 1 << 0,
|
|
normal = 1 << 1,
|
|
luminance = 1 << 2,
|
|
color = 1 << 2,
|
|
alpha = 1 << 3
|
|
};
|
|
|
|
constexpr inline auto position = shader_program_variable({ GL_FLOAT_VEC3, 0 }, "model_vertex_position");
|
|
constexpr inline auto normal = shader_program_variable({ GL_FLOAT_VEC3, 1 }, "model_vertex_normal");
|
|
constexpr inline auto luminance = shader_program_variable({ GL_FLOAT_VEC3, 1 }, "model_vertex_l");
|
|
constexpr inline auto color = shader_program_variable({ GL_FLOAT_VEC3, 1 }, "model_vertex_rgb");
|
|
constexpr inline auto alpha = shader_program_variable({ GL_FLOAT_VEC3, 1 }, "model_vertex_a");
|
|
|
|
constexpr inline auto all = std::array{
|
|
position, normal, luminance, color, alpha
|
|
};
|
|
|
|
constexpr inline auto names = std::array<std::string_view, 5>{
|
|
"position",
|
|
"normal",
|
|
"luminance",
|
|
"color",
|
|
"alpha"
|
|
};
|
|
|
|
|
|
}
|
|
|
|
DEFINE_ENUM_BITFIELD_OPERATORS(zgl::shading::attributes::point_cloud::flags)
|