Render Pipeline
The EntropyPortal render pipeline is a Hybrid Phase-Based architecture. It explicitly phases high-level operations but uses a dynamic WorkGraph to parallelize the heavy lifting of command recording.
Data Flow
Section titled “Data Flow”graph LR
Sim[Simulation Thread] -->|Extract| BackBuf[RenderWorld Back]
subgraph "Double Buffering"
BackBuf
FrontBuf[RenderWorld Front]
end
FrontBuf -->|Read| Render[Render Thread]
Execution Flow
Section titled “Execution Flow”graph TD
Start([Begin Frame]) --> Sync[Swap Buffers & Sync]
Sync --> Shadows[VSM Shadow Update]
subgraph "Phase 1: Shadow & Prep"
Shadows
PrepBounds[Upload Bounds]
end
Shadows --> Probes[Probe Capture]
subgraph "Phase 2: Global Illumination"
Probes -->|Sequential| ProbeFaces[Render Probe Faces]
ProbeFaces -->|Compute| ProbeFit[Spherical Gaussian Fit]
end
ProbeFit --> Cameras[Camera Job Scheduling]
subgraph "Phase 3: Parallel Camera Views (Frame Graph)"
Cameras --> AuxJobs[Auxiliary Cameras]
AuxJobs -->|Dependency| MainJobs[Main Camera]
subgraph "Auxiliary"
AuxJobs
end
subgraph "Main"
MainJobs
end
end
MainJobs --> Composite[Composite]
Composite --> Present([Present])
Key Stages
Section titled “Key Stages”1. Preparation & Extraction
Section titled “1. Preparation & Extraction”- ECS Sync: Camera identities are synchronized from the scene.
- Double-Buffering: The
RenderWorldswaps buffers. The render thread reads from the immutable Front Buffer.
2. Virtual Shadow Maps (VSM)
Section titled “2. Virtual Shadow Maps (VSM)”Shadows are updated first and explicitly.
- View-Dependent: Shadow cascades are calculated for every camera view.
- Page Tables: GPU page tables are updated to map active shadow pages.
3. Probe Capture
Section titled “3. Probe Capture”Light probes (for GI) are updated sequentially.
- On-Demand: Only dirty probes are rendered.
- Fitting: Irradiance is projected into Spherical Gaussians (SG).
4. Camera Job Submission (The Frame Graph)
Section titled “4. Camera Job Submission (The Frame Graph)”This is the core parallel stage using the WorkGraph.
- Job Collection:
RenderServiceiterates theRenderWorldto createFaceJobstructures. - Graph Composition: jobs are added to the
WorkGraph.- Aux Cameras are scheduled first.
- Main Camera is scheduled with a dependency on Aux completion.
- Parallel Recording: Worker threads record independent command buffers.
- Batch Submission: The main thread submits all resulting buffers to the GPU queue.