Skip to main content
Prisma Engine’s rendering system is a modern, modular graphics layer built for C++20. It abstracts over Vulkan and DirectX 12 through a shared IRenderBackend interface, providing forward and deferred pipelines, a high-level Renderer submission API, and an in-progress RenderGraph for automatic resource dependency management and barrier optimization.

Backend architecture

The rendering stack is organized in four layers:
The Vulkan backend runs on Windows, Linux, and Android. Shaders are loaded as SPIR-V binaries compiled from GLSL source via glslangValidator. RenderDoc integration is available for frame capture and debugging.Sources: src/engine/graphic/adapters/vulkan/

Render pipelines

The forward pipeline renders geometry in a single pass per light, keeping memory bandwidth low and making it well-suited for scenes with few light sources or transparent geometry.Passes (in order):

RenderSystem lifecycle

RenderSystem is the top-level manager. Initialize it once at startup, then drive the frame loop with the methods below.
A typical game loop looks like this:

High-level Renderer API

Renderer is a lightweight static submission front-end. It accumulates RenderCommand entries into a queue that the active pipeline consumes during EndScene.

Shader management

Prisma Engine maintains separate shader trees for each backend.
Compile with fxc or dxc to produce DXIL bytecode. Use dxc for shader model 6.x features such as wave intrinsics.
Shader compilation matrix

RenderGraph (in progress)

The engine is migrating from ScriptableRenderPipeline to a RenderGraph architecture. RenderGraph tracks resource reads and writes per pass, resolves barrier placement automatically, and enables parallel pass execution.
Usage example:
RenderGraph is under active development. The RGBuilder::Read / Write dependency tracking is implemented; automatic barrier insertion and aliasing are planned. Refer to docs/RenderGraph_Migration_Plan.md in the repository for the full migration schedule.

Material and mesh descriptors

Material exposes a higher-level mutating API and supports JSON round-trip serialization via nlohmann::json.

Key classes

RenderSystem

Top-level lifecycle manager. Owns the active backend and drives BeginFrame / EndFrame / Present.

Renderer

Static submission API. Collects RenderCommand entries and hands them to the active pipeline.

RenderGraph

Declarative pass graph with typed PassData, RGBuilder setup, and automatic dependency resolution.

IRenderBackend / IResourceFactory

Abstraction boundary. Vulkan and DX12 adapters implement these interfaces independently.

Material

PBR material with albedo, metallic, roughness, and texture map slots. Serializable to JSON.

Camera

Provides GetViewMatrix(), GetProjectionMatrix(), and GetViewProjectionMatrix() for the scene.

Platform-specific notes

The primary backend is DirectX 12. Vulkan is available as an opt-in by passing RenderAPI::Vulkan to RenderSystem::Initialize. Entry point: src/runtime/windows/WindowsRuntime.cpp.
Vulkan is the only supported backend. The Linux CMake presets are defined but not fully validated; community testing is welcome. Entry point: src/runtime/linux/LinuxRuntime.cpp.
Vulkan is the primary backend. GLSL shaders are compiled to SPIR-V automatically by the Android Gradle Plugin. Assets are loaded via AAssetManager. Entry point: src/runtime/android/AndroidRuntime.cpp.