Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
ModernPBRShaderUniforms.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5
6namespace monopoly::engine
7{
8 struct alignas(16) ModernPBRVertexUniforms
9 {
10 std::array<float, 16> worldViewProjection{};
11 std::array<float, 16> world{};
12 };
13
14 struct alignas(16) ModernPBRFragmentUniforms
15 {
16 std::array<float, 4> baseColor{};
17 // x: metallic, y: roughness, z: target already encodes sRGB, w: alpha mask.
18 std::array<float, 4> metallicRoughness{};
19 std::array<float, 4> emissiveStrength{};
20 std::array<float, 4> cameraPosition{};
21 // rgb: ambient/environment intensity; w: specular cubemap enabled (0/1).
22 std::array<float, 4> sceneAmbient{};
23 std::array<float, 4> boardReflectionColorEnabled{};
24 std::array<float, 4> boardReflectionDirection{};
25 std::array<float, 4> sunColorEnabled{};
26 std::array<float, 4> sunDirection{};
27 std::array<float, 4> spotlightColorEnabled{};
28 std::array<float, 4> spotlightPositionRange{};
29 std::array<float, 4> spotlightDirectionFalloff{};
30 std::array<float, 4> spotlightAttenuationTheta{};
31 std::array<float, 4> spotlightPhi{};
32 // Enabled base-color, metallic-roughness, normal and emissive maps.
33 std::array<float, 4> mapFlags{};
34 // x: occlusion enabled, y: normal scale, z: occlusion strength, w: alpha cutoff.
35 std::array<float, 4> mapParameters{};
36 std::array<float, 16> shadowViewProjection{};
37 // x: shadow receiver enabled (negative for depth pass), y: texel size,
38 // z: depth comparison bias, w: optional presentation tone mapping.
39 std::array<float, 4> shadowParameters{};
40 };
41 static_assert(sizeof(ModernPBRVertexUniforms) == 128U);
42 static_assert(sizeof(ModernPBRFragmentUniforms) == 336U);
43 static_assert(offsetof(ModernPBRFragmentUniforms, spotlightPhi) == 208U);
44}
unsigned index