Skip to content

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.

graph LR
    Sim[Simulation Thread] -->|Extract| BackBuf[RenderWorld Back]

    subgraph "Double Buffering"
        BackBuf
        FrontBuf[RenderWorld Front]
    end

    FrontBuf -->|Read| Render[Render Thread]
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])
  • ECS Sync: Camera identities are synchronized from the scene.
  • Double-Buffering: The RenderWorld swaps buffers. The render thread reads from the immutable Front Buffer.

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.

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.

  1. Job Collection: RenderService iterates the RenderWorld to create FaceJob structures.
  2. Graph Composition: jobs are added to the WorkGraph.
    • Aux Cameras are scheduled first.
    • Main Camera is scheduled with a dependency on Aux completion.
  3. Parallel Recording: Worker threads record independent command buffers.
  4. Batch Submission: The main thread submits all resulting buffers to the GPU queue.