Open Asterune
Rendering architecture

Rendering architecture

Follow Asterune's frame pipeline, GPU resources, temporal reconstruction, lighting, and image processing.

Asterune shades scene geometry into a high-dynamic-range (HDR) image, reconstructs that image across frames, and converts it into the displayed picture. The renderer uses wgpu to record graphics and compute commands. Its frame schedule orders passes explicitly; each pass selects its work from scene state, graphics quality, and the active view.

The desktop path combines forward surface shading with screen-space lighting and reflection passes. Opaque draws also write surface information and motion vectors. These auxiliary targets let later passes trace visible geometry and reproject earlier samples without evaluating the entire material again.

Frames, resources, and visibility

A render frame includes more than the final color target. Depth, surface data, motion, reflection contributions, and temporal histories have different readers and lifetimes. A pass must finish writing a resource before a dependent pass samples it. Previous-frame resources also require explicit preservation when an interface camera reuses the main view's targets.

Frame pipeline and resources follows a frame from CPU draw preparation through GPU submission. It explains the pass dependencies, attachment formats, stereo reuse, and the distinction between submission and GPU completion.

Geometry, depth, and transparency explains reverse-Z depth, cached draw commands, instancing, GPU occlusion culling, depth reductions, skinning, and translucent composition.

Mesh simplification and impostors explains quadric edge collapse, screen-size selection, dithered transitions, and the capture and lighting of distant-model proxies.

Temporal reconstruction and anti-aliasing

Temporal anti-aliasing (TAA) moves the projection by a subpixel offset and combines samples from successive frames. Motion vectors identify the earlier location of a surface. Depth tests, neighborhood bounds, and reactive signals control which history samples remain usable.

Temporal anti-aliasing and reconstruction describes the implemented jitter sequence, motion encoding, history rejection, color clipping, accumulation, and temporal upscaling. It also covers stationary history behavior and resets.

Anti-aliasing and render resolution separates TAA from multisample anti-aliasing (MSAA), fast approximate anti-aliasing (FXAA), and specular anti-aliasing. It explains sample-count negotiation, scene resolve, the headset path, and internal versus output resolution.

Surface shading, light, and reflections

Surface shading combines material color, roughness, metalness, normals, occlusion, and emission with light and environment data. Material sets and MaterialVariant rows supply shared definitions; SurfaceAppearance supplies per-part surface channels. Surface shaders extend this evaluation. Full-screen ShaderEffect instances execute later in the display chain.

Material evaluation and shader variants explains material-table indirection, shared appearance rows, channel-aware mip filtering, relief sampling, and asynchronous pipeline specialization. A draw without maps or layers can remove those branches before GPU execution.

Lighting and reflections explains the material lighting equation, clustered local lights, shadow maps, environment captures, probes, and irradiance. It traces the separate screen-space paths for occlusion, indirect lighting, contact shadows, and reflections.

Atmosphere, clouds, and volumetric light traces scattering lookup tables, cloud ray marching, temporal view reconstruction, and fog integration. Water surfaces and optical depth follows analytical displacement, refraction, absorption, and focused caustics. Particle simulation and ribbons explains particle storage, simulation backends, transparency ordering, and ribbon geometry.

Lens and display processing

Temporal reconstruction precedes motion blur and depth of field. Exposure, bloom, and tone mapping operate on HDR inputs before display effects and interfaces. The renderer tracks the active intermediate image so each pass samples the preceding result and writes a different target.

Lens effects and display processing follows those image transformations, including motion sampling, focus blur, luminance metering, tone mapping, custom effects, and interface composition.

For the controls exposed to game scripts, use the environment guide, MaterialService, SurfaceAppearance, and ShaderEffect.