Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
FrameConstants.hpp File Reference

Per-frame shader constants shared via a single Uniform Buffer Object. More...

#include "../../core/Types.hpp"
#include "../rhi/GfxEnums.hpp"
#include <glm/glm.hpp>
#include <cmath>
Include dependency graph for FrameConstants.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esengine::FrameConstants
 CPU mirror of the GLSL FrameConstants block (std140). More...
struct  esengine::TimeConstants
 CPU mirror of the injected TimeConstants block (std140). More...

Namespaces

namespace  esengine

Functions

glm::vec4 esengine::cameraFromViewProjection (const glm::mat4 &viewProjection)
 Where the frame is seen from, read out of the matrix that projects it.
glm::mat4 esengine::toClipDepthRange (const glm::mat4 &p, ClipDepthRange range)
 The projection p as a device keeping range wants it.

Variables

constexpr u32 esengine::FRAME_CONSTANTS_BINDING = 0
 Indexed uniform binding point the FrameConstants block is bound to.
constexpr const char * esengine::FRAME_CONSTANTS_BLOCK = "FrameConstants"
 GLSL block name; must match the shader declarations and Shader::compile lookup.
constexpr u32 esengine::TIME_CONSTANTS_BINDING = 3
constexpr const char * esengine::TIME_CONSTANTS_BLOCK = "TimeConstants"

Detailed Description

Per-frame shader constants shared via a single Uniform Buffer Object.

The engine's per-frame data (the view-projection) lives in exactly one UBO, bound once per frame at FRAME_CONSTANTS_BINDING. Every engine shader declares layout(std140) uniform FrameConstants { mat4 u_projection; }; and Shader::compile auto-links that block to the binding point — there is no loose per-shader u_projection upload. This is the first non-texture resource of the eventual BindGroup model.

Author
ESEngine Team
Date
2026

Definition in file FrameConstants.hpp.