Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
World3DShaderUniforms.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5
6namespace monopoly::engine
7{
8 // Shared ABI for World3D HLSL/DXIL/MSL, used by both the 3D renderer
9 // and the unlit 2D texture pipeline. Keep stage layouts in one place.
10 struct alignas(16) World3DVertexUniforms
11 {
12 std::array<float, 16> worldViewProjection{};
13 std::array<float, 16> world{};
14 std::array<float, 4> materialDiffuse{};
15 std::array<float, 4> sceneAmbient{};
16 std::array<float, 4> boardReflectionColorEnabled{};
17 std::array<float, 4> boardReflectionDirection{};
18 std::array<float, 4> sunColorEnabled{};
19 std::array<float, 4> sunDirection{};
20 std::array<float, 4> spotlightColorEnabled{};
21 std::array<float, 4> spotlightPositionRange{};
22 std::array<float, 4> spotlightDirectionFalloff{};
23 std::array<float, 4> spotlightAttenuationTheta{};
24 std::array<float, 4> spotlightPhi{};
25 };
26
27 struct alignas(16) World3DFragmentUniforms
28 {
29 std::array<float, 4> materialDiffuse{};
30 };
31 static_assert(sizeof(World3DVertexUniforms) == 304U);
32 static_assert(sizeof(World3DFragmentUniforms) == 16U);
33
34 static_assert(offsetof(World3DVertexUniforms, world) == 64U);
35 static_assert(offsetof(World3DVertexUniforms, materialDiffuse) == 128U);
36 static_assert(offsetof(World3DVertexUniforms, sceneAmbient) == 144U);
37 static_assert(offsetof(World3DVertexUniforms, spotlightPhi) == 288U);
38}
unsigned index