Prisma Engine’s rendering system is a modern, modular graphics layer built for C++20. It abstracts over Vulkan and DirectX 12 through a sharedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/PrismaEngine/llms.txt
Use this file to discover all available pages before exploring further.
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:- Vulkan
- DirectX 12
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
- Forward pipeline
- Deferred pipeline
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):
| Pass | File | Purpose |
|---|---|---|
DepthPrePass | pipelines/forward/DepthPrePass.* | Fill the depth buffer before shading |
OpaquePass | pipelines/forward/OpaquePass.* | Shade fully opaque geometry |
TransparentPass | pipelines/forward/TransparentPass.* | Alpha-blended geometry, back-to-front sorted |
RenderSystem lifecycle
RenderSystem is the top-level manager. Initialize it once at startup, then drive the frame loop with the methods below.
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.- HLSL (DirectX 12)
- GLSL (Vulkan)
fxc or dxc to produce DXIL bytecode. Use dxc for shader model 6.x features such as wave intrinsics.| Platform | Compiler | Output |
|---|---|---|
| Windows (DX12) | fxc / dxc | DXIL bytecode |
| Windows (Vulkan) | glslangValidator | SPIR-V |
| Linux | glslangValidator | SPIR-V |
| Android | Android Gradle Plugin | SPIR-V (automatic) |
RenderGraph (in progress)
The engine is migrating fromScriptableRenderPipeline to a RenderGraph architecture. RenderGraph tracks resource reads and writes per pass, resolves barrier placement automatically, and enables parallel pass execution.
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
Windows
Windows
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.Linux
Linux
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.Android
Android
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.