Rendering Guide

OpenReality features a physically-based rendering pipeline with deferred shading, cascaded shadow maps, image-based lighting, and configurable post-processing.

# Rendering Backends

Four backends target different platforms. Switch between them with a single parameter.

backends.jl

# Deferred Rendering Pipeline

The Vulkan backend uses a full deferred pipeline with G-Buffer rendering, decoupling geometry from lighting for efficient multi-light scenes.

deferred.jl

# PBR Materials

Materials use the metallic-roughness PBR model with full texture support. All texture references are resolved lazily and cached by the TextureCache.

pbr.jl

# Advanced Material Features

Three advanced material features for realistic surface rendering.

advanced_materials.jl

# Cascaded Shadow Maps

Directional lights automatically produce cascaded shadow maps with four cascades, PCF filtering, and slope-scaled bias for clean shadow boundaries at all distances.

shadows.jl

# Image-Based Lighting

Add an HDR environment map for physically accurate reflections and ambient lighting. The engine generates irradiance, prefiltered environment, and BRDF lookup textures automatically.

ibl.jl

# Post-Processing

Configure the HDR post-processing pipeline with bloom, tone mapping, and anti-aliasing. Additional screen-space effects (SSAO, SSR, TAA, DOF, motion blur) are available on the Vulkan backend.

postprocess.jl

# Transparency

The renderer uses a two-pass approach: opaque entities first, then transparent entities sorted back-to-front. Alpha cutoff provides efficient masked rendering for foliage and fences.

transparency.jl

# Shader Variants

Instead of a single uber-shader, the engine compiles shader variants on-demand based on the features each material uses. Variants are cached in the ShaderLibrary for reuse.

shader_variants.jl