menu_bookDocumentation

Post Processing System

calendar_today May 3, 2026 schedule ~1 min read person patrickjr verified 50

Post Processing System

Add visual effects like bloom, tonemapping, and film grain with post-processing volumes.

Overview

Post processing in s&box uses a volume-based system:

  • PostProcessVolume components define effect regions

  • BasePostProcess shaders create custom effects

  • Effects blend based on volume weight and priority

Creating Custom Effects

Inherit from BasePostProcess<T>:

CSHARP
public sealed class MyBrightnessEffect : BasePostProcess<MyBrightnessEffect>
{
    [Property, Range(-1, 1)]
    public float Brightness { get; set; }
    
    public override void Render()
    {
        // Apply post-processing shader
        var shader = Material.Load("materials/postprocess/brightness.vmat");
        shader.SetFloat("brightness", Brightness);
        Graphics.Blit(shader);
    }
}

PostProcessVolume

Control where effects apply:

CSHARP
public class BrightnessVolume : PostProcessVolume
{
    public MyBrightnessEffect Effect { get; set; }
    
    protected override void OnUpdate()
    {
        // Update effect parameters
        Effect.Brightness = CalculateBrightnessForPosition(WorldPosition);
    }
}

Volume Properties

PropertyPurpose
PriorityHigher priority volumes override lower ones
Weight0-1 blend factor for this volume's effects
IsGlobalApply to entire scene regardless of position

Blending Effects

Multiple volumes blend together:

CSHARP
// Volume A: Bloom in one area
// Volume B: Tonemapping in another
// Where they overlap: Both effects apply with blended weights

Built-in Effects

Common post-processing effects available:

EffectDescription
BloomGlow around bright areas
TonemappingHDR to LDR color mapping
Film GrainCinematic noise texture
Chromatic AberrationRGB channel separation at edges
VignetteDarkening at screen edges
Motion BlurBlur based on camera movement
Depth of FieldFocus-based blur
Color GradingLUT-based color correction

Performance Tips

  • Minimize overlapping volumes
  • Use lower resolution effects for distant areas
  • Disable effects when not visible
  • Combine multiple effects into single shader when possible
  • Use IsGlobal = false for localized effects
Was this helpful?