1. Dashboard
  2. Getting Started
  3. GitHub
  4. API
  5. Articles
  6. Level Editor
  7. Members
    1. Recent Activity
    2. Users Online
    3. Staff
    4. Search Members
  8. Forum
  9. Discord
  • Login
  • Register
  • Search
Getting Started
  • Everywhere
  • Getting Started
  • Articles
  • Pages
  • Forum
  • More Options
  1. GFX-Engine
  2. Articles
  3. Getting Started

Rendering Pipeline & Post Processing

  • Andy
  • January 4, 2026 at 1:08 AM
  • 231 Views
  • 0 Comments

This article explains how rendering, render targets, and post processing are structured in GFX-Next. It provides a high-level view of the rendering pipeline, describing how render passes are organized, how intermediate and final render targets are managed, and how data flows between stages. The article details how render targets are created, reused, and synchronized across passes, ensuring both performance and correctness. It also explains the role of post-processing stages—such as tone mapping, color grading, and screen-space effects—and how they are composed in a flexible, extensible manner. By understanding this structure, developers gain insight into how GFX-Next balances visual quality, performance, and maintainability within its rendering architecture.

Contents [hideshow]
  1. Rendering Is Scene-Driven
  2. Camera & Viewport
  3. Render Targets
  4. Shadow Rendering Pass
  5. Main Scene Render Pass
  6. Renderer Responsibilities
  7. Post Processing Pipeline
  8. Applying Post Processing
  9. Final Composition
  10. UI & HUD Rendering
  11. Debugging & Render Safety
  12. Summary

The rendering pipeline is designed to be:

  • explicit
  • modular
  • editor-safe
  • free of hidden render passes

1. Rendering Is Scene-Driven

In GFX-Next, rendering is not owned by GameElements.
Instead, the Scene controls the render flow.

C#
Scene.RenderShadowMaps(Viewport, RenderDevice, Camera);
Scene.Render(Viewport, RenderDevice, Camera);

This keeps:

  • draw order centralized
  • render passes deterministic
  • editor and runtime behavior identical

2. Camera & Viewport

Rendering always requires:

  • a Camera
  • a Viewport
C#
Scene.Render(Viewport, RenderDevice, Camera);

The camera defines:

  • view matrix
  • projection matrix
  • view position (lighting)

The viewport defines:

  • render resolution
  • aspect ratio
  • render target dimensions

This separation allows:

  • split-screen rendering
  • editor viewports
  • offscreen rendering

3. Render Targets

Scenes render into a render target, not directly to the backbuffer.

C#
var renderTarget = Scene.RenderTarget as MSAARenderTarget2D;

This enables:

  • MSAA
  • post processing
  • render-to-texture workflows
  • editor previews

The backbuffer is only used for the final presentation step.


4. Shadow Rendering Pass

Shadow maps are rendered explicitly.

C#
Scene.RenderShadowMaps(Viewport, RenderDevice, Camera);

Characteristics:

  • separate depth-only pass
  • light-driven
  • resolution controlled per light
  • no implicit shadow generation

This keeps shadow rendering:

  • predictable
  • debuggable
  • scalable

5. Main Scene Render Pass

The main scene render pass:

  • binds camera matrices
  • resolves materials
  • draws all visible elements
  • respects transparency order
C#
Scene.Render(Viewport, RenderDevice, Camera);

Key points:

  • no per-object render logic
  • no hidden state changes
  • render stats are tracked centrally

6. Renderer Responsibilities

The renderer is a low-level execution layer.

C#
renderer.DrawMesh(transform, mesh, materialOverride);

The renderer:

  • binds shaders
  • uploads uniforms
  • issues draw calls
  • never owns scene state
  • never decides what to draw

This strict separation prevents:

  • state leaks
  • implicit behavior
  • frame-order bugs

7. Post Processing Pipeline

Post processing is handled via a PostProcessStack.

Code
_postProcessStack = new PostProcessStack();
_postProcessStack.Filter.Add(BrightnessContrastFX.Cinematic);

Post processing:

  • operates on render targets
  • is independent of scene rendering
  • can be reordered freely

8. Applying Post Processing

Post processing is applied after the scene render pass.

Code
_postProcessStack.Apply(RenderDevice, renderTarget.TextureId);

This produces a final render target that can be:

  • drawn to the backbuffer
  • used as input for further passes
  • displayed in an editor viewport

9. Final Composition

The final image is presented explicitly.

C#
RenderDevice.DrawRenderTarget(
    _postProcessStack.RenderTarget,
    GLRenderer.Backbuffer
);

There is no automatic fullscreen pass.
Everything is explicit.


10. UI & HUD Rendering

UI is rendered after the 3D pipeline.

C#
HUD.Render(Viewport, RenderDevice);
RenderDevice.DrawRenderTarget(HUD.RenderTarget, GLRenderer.Backbuffer);

This guarantees:

  • UI is not affected by post processing
  • pixel-perfect rendering
  • clear separation between 3D and 2D

11. Debugging & Render Safety

The pipeline is designed for debugging:

  • render passes are explicit
  • render targets are inspectable
  • stats are tracked per frame
  • no implicit frame graph

This makes rendering behavior:

  • reproducible
  • understandable

Summary

The rendering system in GFX-Next is built around:

  • scene-controlled render flow
  • explicit render passes
  • render-target-based composition
  • modular post processing
  • strict separation of responsibilities

This avoids hidden complexity and keeps the rendering pipeline transparent and predictable.

  • Previous Article Meshes, Primitives & Materials
  • Next Article Application Structure & Game Loop

Categories

  1. Advanced Tutorial 1
  2. Getting Started 8
  3. Default Category 1
  4. Reset Filter

Partner & Supporter

  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™