Further shader compilation development.
This commit is contained in:
45
include/opengl/shading/attributes/mesh_attributes.hpp
Normal file
45
include/opengl/shading/attributes/mesh_attributes.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
|
||||
#include "util/enum_bitfield_operators.hpp"
|
||||
#include <array>
|
||||
#include <string_view>
|
||||
|
||||
namespace zgl::shading::attributes::mesh
|
||||
{
|
||||
|
||||
enum class flags : std::uint8_t
|
||||
{
|
||||
none = 0,
|
||||
position = 1 << 0,
|
||||
normal = 1 << 1,
|
||||
luminance = 1 << 2,
|
||||
color = 1 << 3,
|
||||
alpha = 1 << 4,
|
||||
tex_coord = 1 << 5
|
||||
};
|
||||
|
||||
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, 2 }, "model_vertex_l");
|
||||
constexpr inline auto color = shader_program_variable({ GL_FLOAT_VEC3, 2 }, "model_vertex_rgb");
|
||||
constexpr inline auto alpha = shader_program_variable({ GL_FLOAT, 3 }, "model_vertex_a");
|
||||
constexpr inline auto tex_coord = shader_program_variable({ GL_FLOAT_VEC2, 2 }, "model_vertex_tex_coord");
|
||||
|
||||
constexpr inline auto all = std::array{
|
||||
position, normal, luminance, color, alpha, tex_coord
|
||||
};
|
||||
|
||||
constexpr inline auto names = std::array<std::string_view, 6>{
|
||||
"position",
|
||||
"normal",
|
||||
"luminance",
|
||||
"color",
|
||||
"alpha",
|
||||
"tex_coord"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
DEFINE_ENUM_BITFIELD_OPERATORS(zgl::shading::attributes::mesh::flags)
|
||||
42
include/opengl/shading/attributes/point_cloud_attributes.hpp
Normal file
42
include/opengl/shading/attributes/point_cloud_attributes.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#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)
|
||||
Reference in New Issue
Block a user