238 void initDefaultTextures();
243 void uploadFrameConstants(
const glm::mat4& upload,
const glm::mat4& engine);
245 glm::mat4 viewProjection_{1.0f};
246 u64 program_epoch_ = 0;
262 PerDrawBlocks skinBlocks_;
263 PerDrawBlocks probeBlocks_;
264 PerDrawBlocks instanceBlocks_;
265 PerDrawBlocks planarBlocks_;
270 return {&skinBlocks_, &probeBlocks_, &instanceBlocks_, &planarBlocks_};
274 skinBlocks_.beginFrame();
275 probeBlocks_.beginFrame();
276 instanceBlocks_.beginFrame();
277 planarBlocks_.beginFrame();
281 f32 lastElapsed_ = 0.0f;
282 f32 viewExposure_ = 0.0f;
283 glm::vec4 qualityConstants_{0.0f};
284 QualityValues qualityValues_;
285 MaterialStore materials_;
288 ReflectionStore reflections_;
291 bool initialized_ =
false;
GPU buffer abstractions for vertex and index data.
Backend-agnostic graphics enumerations.
Engine-side 2D light registry — the per-frame LightConstants UBO and its CPU mirror.
Engine-side material registry — the resolved "how to draw" for a material handle.
A uniform range per draw, so two draws never write into one block.
Which baked grid a point stands in, and what it says there.
Which baked reflection a point stands in — the specular half of the question ProbeStore answers for i...
GPU shader program abstraction.
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
Holds the per-frame 2D lights and their GPU UBO. Mirrors MaterialStore's UBO lifecycle (lazy create,...
Maps a material handle to its resolved record. Owned by RenderContext so it is reachable from both th...
The frame's probe volumes, and the trilinear read through them.
The frame's reflection probes, and the lookup that picks one.
const glm::mat4 & viewProjection() const
Gets the current view-projection matrix (const).
ReflectionStore & reflections()
The frame's reflection probes — the same question about the half of the environment a surface MIRRORS...
void advanceProgramEpoch()
Declares that programs which WERE ready have gone cold.
static u32 frameConstantsSize()
Bytes a buffer passed to useFrameConstants must hold.
void prepareFrameConstants(BufferHandle ubo, const glm::mat4 &viewProjection)
Stage a light view before the render passes and switch to it without a mid-pass upload.
u64 programEpoch() const
Which generation of renderer PROGRAM readiness is current.
void setQualityConstants(const glm::vec4 &values)
bool isInitialized() const
Checks if the context is initialized.
void restoreBuiltinContent()
Builds again what this context made from code alone and the device lost: call once the device is back...
const ProbeStore & probes() const
void updateCameraConstants(const glm::mat4 &viewProjection)
Point the frame at what a CAMERA sees.
LightStore & lights()
The engine-side per-frame 2D light registry (binding 2 LightConstants UBO).
void bindFrameConstants(BufferHandle ubo)
const ReflectionStore & reflections() const
void init()
Initializes rendering resources.
void setFrameTime(f32 elapsedSec, u32 viewportW, u32 viewportH)
Uploads the frame clock + canvas size into the injected TimeConstants UBO.
void beginPerDrawBlocks()
Hand every one of them back at the top of a frame.
MaterialStore & materials()
The engine-side material registry (handle -> resolved render state).
glm::mat4 & viewProjection()
Gets the current view-projection matrix.
const MaterialStore & materials() const
BufferHandle frameUbo() const
The buffer the camera's FrameConstants live in, for a compute pass that reads them (it is bound at gr...
PerDrawBlockSet perDrawBlocks()
The blocks the draw loop rewrites before each draw.
void updateFrameConstants(const glm::mat4 &viewProjection)
Point the frame at a pass whose projection already suits the device.
RenderContext(const RenderContext &)=delete
ProbeStore & probes()
The frame's probe volumes. Gathered beside the lights, because it answers the same question at the po...
u32 getWhiteTextureId() const
Gets the white texture handle's raw value (for untextured quads).
TextureHandle getWhiteTexture() const
RenderContext & operator=(const RenderContext &)=delete
const LightStore & lights() const
void useFrameConstants(BufferHandle ubo, const glm::mat4 &viewProjection)
Frame constants for viewProjection in a buffer the CALLER owns, bound.
const QualityValues & qualityValues() const
RenderContext(GfxDevice &device)
QualityValues & qualityValues()
void setViewExposure(f32 ev)
The editor view's exposure, in stops, carried to the output blit in u_time.z. VIEW state: zero (the d...
void shutdown()
Releases all rendering resources.
std::uint64_t u64
Unsigned 64-bit integer.
std::uint32_t u32
Unsigned 32-bit integer.
float f32
32-bit floating point
The uniform blocks a draw rewrites immediately before it.