Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Geometry Passes

Geometry passes render scene objects into the HDR color buffer and the depth buffer. Each pass handles a different category of geometry and writes a subset of the available render targets.

ClearPass

The ClearPass clears scene_color to black and depth to 0.0, which is the reversed-Z far plane. It always runs first so every other pass sees a known starting state.

Writes: scene_color, depth

SkyPass

The SkyPass renders the sky or atmosphere background. The mode is selected by world.resources.graphics.atmosphere.

  • Atmosphere::None is a solid background color and is the default.
  • Atmosphere::Sky is a procedural clear-sky gradient.
  • Atmosphere::CloudySky is a procedural sky with volumetric clouds.
  • Atmosphere::Space is a procedural starfield.
  • Atmosphere::Nebula is a procedural nebula with stars.
  • Atmosphere::Sunset is a procedural sunset gradient.
  • Atmosphere::DayNight is a procedural day-night cycle driven by an hour parameter.
  • Atmosphere::Hdr is an HDR environment cubemap.

Writes: scene_color

ScenePass

The ScenePass is a basic scene rendering pass for simple objects that do not need the full PBR pipeline.

Reads/Writes: scene_color, depth

MeshPass

The MeshPass is the main PBR mesh rendering pass. It renders all entities with RENDER_MESH | MATERIAL_REF | GLOBAL_TRANSFORM. The fragment shader does PBR shading with the metallic-roughness workflow, samples the shadow depth texture for cascaded shadow maps, samples the spotlight shadow atlas, applies normal mapping from a per-material normal texture, and supports opaque, mask, and blend alpha modes. The same shader output also writes entity IDs for GPU picking and view-space normals for SSAO and SSGI, all in a single fragment invocation.

Reads: shadow_depth, spotlight_shadow_atlas Writes: scene_color, depth, entity_id, view_normals

SkinnedMeshPass

The SkinnedMeshPass renders animated skeletal meshes. It reads bone matrices from the skinning buffer and transforms vertices on the GPU.

Reads: shadow_depth, spotlight_shadow_atlas Writes: scene_color, depth

GrassPass

The GrassPass is GPU-instanced grass rendering. It renders thousands of grass blades using instance data from GrassRegion components, with wind animation and interactive bending driven by GrassInteractor components.

Reads/Writes: scene_color, depth

DecalPass

The DecalPass renders projected decals onto scene geometry. Each decal samples the depth buffer to project its texture onto whatever surface is behind it.

Reads/Writes: scene_color, depth

ParticlePass

The ParticlePass is GPU billboard particle rendering. It reads ParticleEmitter component data and renders camera-facing quads, one per particle.

Reads/Writes: scene_color, depth

TextPass

The TextPass renders 3D world-space text using the font atlas.

Reads/Writes: scene_color, depth

HudPass

The HudPass renders screen-space HUD text. Unlike the TextPass, HUD text is positioned in screen coordinates with configurable anchoring rather than placed in the world.

Reads/Writes: scene_color, depth

LinesPass

The LinesPass renders debug lines from Lines components. The pass is the workhorse for visualization, bounding boxes, and any other debug geometry.

Reads/Writes: scene_color, depth

GridPass

The GridPass renders an infinite ground grid. It is gated on world.resources.graphics.show_grid.

Reads/Writes: scene_color, depth

UiRectPass

The UiRectPass renders UI rectangles for the immediate-mode UI system.

SelectionMaskPass

The SelectionMaskPass generates a selection mask texture for selected entities. The editor uses it to drive selection outlines.

Reads: depth Writes: selection_mask

OutlinePass

The OutlinePass reads the selection mask and renders outlines around selected entities by detecting edges in the mask.

Reads: selection_mask Writes: scene_color

ProjectionPass / HiZPass

The ProjectionPass and HiZPass build a hierarchical-Z buffer for occlusion culling.