Skip to content

Namespace Apogee.Rendering

Namespaces

Apogee.Rendering.Graph

Apogee.Rendering.Shaders

Classes

Camera

A perspective camera in a right-handed world (+Y up, looking down -Z at yaw 0). The projection is reverse-Z with an infinite far plane: the near plane maps to depth 1 and infinity to 0, which spreads float precision evenly over the whole depth range. Normalized device y points down, as in Vulkan, so no viewport flip is needed; the image, and so the winding of triangles (counter-clockwise for front faces, as in glTF), is unchanged. The position is a (the world is double precision) and the renderer works relative to it: has the camera at the origin, and everything else is turned into an offset from the camera before it reaches the GPU.

ClusterGrid

The grid lights are culled against: 16 x 9 cells over the screen and 24 slices in depth, spaced exponentially from the camera's near plane to so that near slices are thin. This is the CPU twin of the shaders (cluster_build and common.slang), for tests and tools.

DebugDrawLibrary

Debug drawing for Luau scripts, as the global table debug_draw: lines and shapes that last one frame, drawn over the world. Call them every frame (from a system, or from the devtools.on_gui function) for as long as they should show. Colors are vectors of red, green and blue from 0 to 1; without one a line is white. Positions are the world's. With nowhere to draw (no renderer) the calls do nothing.

ExposureMath

The photographic exposure maths of the renderer, on the CPU: the twin of exposure.slang and of the exposure functions in common.slang, which the tests compare it with.

Scene light is photometric: the forward pass writes luminance in cd/m2 (a sun of E lux on a white diffuse surface gives E / pi cd/m2). The camera's exposure is an EV100, the exposure value at ISO 100: EV100 = log2(N^2 / t) - log2(S / 100) for an aperture f/N, a shutter time t in seconds and a sensitivity S. The forward pass multiplies its result by , the saturation-based exposure of a camera at that EV100, so the HDR image holds exposed values: 1.0 is the luminance that just saturates the sensor, 1.2 * 2^EV100 cd/m2, and a fp16 image cannot overflow with a bright sun.

GpuModel

A on the GPU: its vertices, indices, materials and textures in buffers and in the bindless heap. It is placed in the world any number of times (by a , or by entities with a ); each placement costs one instance record per mesh instance, never another copy of the data.

ModelLibrary

The models that entities draw ( is an id from here; scripts see this as models). A model is loaded once per path whatever the number of entities that show it, and reloaded in place when its file changes, so entities keep their id. Ids are never reused.

OverlayChain

Several overlays as one, drawn in order over the finished image: the game's UI first, the dev tools on top of it.

RenderScene

One placed in the world, with the lights and sky it is lit with. The lights can be changed every frame. The model's own coordinates (instance transforms, light positions, bounds) are relative to the scene's , a position in the double-precision world; every frame the renderer turns them into offsets from the camera, so a scene can be anywhere in the world. For many models, or for models placed by entities, see .

RenderSettings

RenderStats

RenderWorld

An ECS as something to draw: every entity with a and a shows its model there, every lights it, and the entity with is the eye (). Nothing is copied: the world is read when a frame is rendered, so what the systems moved this frame is what is drawn.

SceneRenderer

The Forward+ renderer. Every frame it builds a render graph: a depth prepass, a light-culling compute pass over the 16 x 9 x 24 cluster grid, the PBR forward pass (opaque and alpha-masked, then blended draws far to near), and a tone-mapping pass into the target.

Structs

CameraComponent

A perspective camera at the entity's , looking along its -Z. The entity that also has is the one the world is drawn through. Roll is ignored: the camera turns about +Y (yaw) and then up or down (pitch).

GpuDebugPush

GpuDrawPush

GpuExposurePush

The push constants of both auto-exposure passes (exposure.slang).

GpuFrameData

GpuFramePush

GpuInstance

GpuLight

GpuMaterial

GpuTonemapPush

Gt7ToneMapping

The Gran Turismo 7 tone mapping operator, on the CPU: the twin of the one in tonemap.slang, which the tests compare it with. It is a port of Polyphony Digital's sample implementation gt7_tone_mapping.cpp (version 1.0, MIT licence, Copyright (c) 2025 Polyphony Digital Inc.; the notice is in Legal/THIRD_PARTY_NOTICES.md).

The operator works on linear Rec.2020 colors in "frame-buffer" units, where 1.0 is (100) cd/m2. It tone-maps each channel with a curve (a toe, a linear section and an exponential shoulder that converges on the display's peak), then blends that with a version whose lightness comes from the curved color but whose chroma (in ICtCp) is kept and faded out near the peak, so bright colors desaturate towards white instead of changing hue. In SDR mode the peak is (250 cd/m2) and the result is scaled so that 1.0 is the display's white, ready for the sRGB transfer function.

Light

A light at the entity's , shining along its -Z (as glTF lights do). A directional light is the world's sun: its color and direction set the sun (the first one wins), and its position does not matter.

MainCamera

Marks the the world is drawn through (the first one found, when several have it).

ModelRenderer

Draws a model at the entity's : its position, rotation and scale place every mesh of the model. is an id from the (models.load in scripts); 0, or an id the library no longer knows, draws nothing. Many entities may share a model.

RenderTarget

Where the final image goes: the window's image, an offscreen one that is read back, or one that is drawn as a texture afterwards (an editor's viewport).

TextureTransforms

UInt4

Interfaces

IRenderOverlay

Something drawn over the finished image: the dev overlay. It adds its own pass to the frame's graph.

Enums

DebugView

ExposureMode

How the camera's exposure is chosen.

Tonemapper

The tone mapper that turns the exposed HDR image into the display's range. See Docs/manual/graphics/tone-mapping.md.