Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
ProbeConstants.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
17#pragma once
18
19#include "../../core/Types.hpp"
20
21#include <glm/glm.hpp>
22
23namespace esengine {
24
26inline constexpr u32 PROBE_CONSTANTS_BINDING = 7;
27
29inline constexpr const char* PROBE_CONSTANTS_BLOCK = "ProbeConstants";
30
39inline constexpr u32 PROBE_MAX_INSTANCES = 100;
40
42inline constexpr u32 PROBE_TEXELS = 10;
43
49 glm::vec4 irradiance[9]{};
55 glm::vec4 reflection{0.0f};
56};
57
58static_assert(sizeof(ProbeConstants) == 16 * PROBE_TEXELS,
59 "ProbeConstants must be a tight array of vec4 to match std140");
60
69inline constexpr u32 PROBE_BLOCK_BYTES =
70 static_cast<u32>(sizeof(ProbeConstants)) * PROBE_MAX_INSTANCES + 16;
71
72} // namespace esengine
Core type definitions and utilities for ESEngine.
constexpr u32 PROBE_CONSTANTS_BINDING
Indexed UBO binding point for the per-draw ProbeConstants block.
constexpr const char * PROBE_CONSTANTS_BLOCK
GLSL block name; must match the injected Lit header + Shader::compile lookup.
constexpr u32 PROBE_MAX_INSTANCES
How many instances of one merged draw carry their own irradiance.
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
constexpr u32 PROBE_BLOCK_BYTES
Bytes the block is declared with: every run, then one vec4 that is not data.
constexpr u32 PROBE_TEXELS
Texels one instance's indirect light occupies in that block.
The indirect light one instance stands in — both halves of it.