Class PostProcessRenderer
Namespace: ValveResourceFormat.Renderer.PostProcess
Assembly: Renderer.dll
Post-processing renderer for tonemapping, color grading, and adaptive exposure.
public class PostProcessRendererInheritance
object ← PostProcessRenderer
Constructors
PostProcessRenderer(RendererContext)
Initializes a new PostProcessRenderer using the given renderer context.
public PostProcessRenderer(RendererContext rendererContext)Parameters
rendererContext RendererContext
The renderer context providing shader loading and mesh buffer access.
Properties
AverageLuminance
Gets or sets the scene average luminance used for auto-exposure calculations.
public float AverageLuminance { get; set; }Property Value
float
Bloom
Gets the bloom renderer used for the multi-pass Gaussian bloom effect.
public BloomRenderer Bloom { get; }Property Value
BlueNoise
Gets or sets the blue noise texture used for dithering in the tonemap pass.
public RenderTexture? BlueNoise { get; set; }Property Value
ColorCorrectionEnabled
Gets or sets a value indicating whether color correction LUT application is active.
public bool ColorCorrectionEnabled { get; set; }Property Value
bool
CurrentExposure
Gets the smoothed exposure value applied in the current frame.
public float CurrentExposure { get; }Property Value
float
CustomExposure
Gets or sets a manually overridden exposure value; set to -1 to use auto-exposure.
public float CustomExposure { get; set; }Property Value
float
DOF
Gets the depth-of-field renderer.
public DOFRenderer DOF { get; }Property Value
DefaultColorFormat
Gets the HDR color attachment format used by post-process framebuffers.
public static ImageFormat DefaultColorFormat { get; }Property Value
EffectsBloom
Gets this frame's effects bloom map, geometry drawn to show only as glow, or null when nothing drew into it. It is bloomed even when no post process volume enables bloom, with the default settings and without blooming the scene itself.
public RenderTexture? EffectsBloom { get; }Property Value
Enabled
Gets or sets a value indicating whether post-processing is active.
public bool Enabled { get; set; }Property Value
bool
ExposureCompensation
Gets or sets the viewer's exposure compensation in stops, added on top of whatever the post process volume authors. Applied after the exposure clamp, so it still works on the many scenes that pin exposure to an authored bound.
public float ExposureCompensation { get; set; }Property Value
float
ExposureHistory
Gets the per-frame raw exposure scalar history used for temporal smoothing.
public List<float> ExposureHistory { get; }Property Value
List<float>
ExposureTargetLuminance
Gets the pre-tonemap scene luminance auto-exposure aims for: the value the active tonemap curve displays as PostProcessRenderer.MiddleGrey.
public float ExposureTargetLuminance { get; }Property Value
float
FullScreenGamma
Gets or sets the display gamma, the game's brightness setting. 2.2 is identity; lower is brighter.
public float FullScreenGamma { get; set; }Property Value
float
HasOutlineObjects
Gets or sets a value indicating whether any scene objects require outline rendering this frame.
public bool HasOutlineObjects { get; set; }Property Value
bool
OutlineMask
Gets or sets the multisampled coverage mask produced by the outline geometry pass.
public RenderTexture? OutlineMask { get; set; }Property Value
State
Gets or sets the current post-processing state (tonemap, bloom, exposure settings).
public PostProcessState State { get; set; }Property Value
TargetExposure
Gets the target exposure value that PostProcessRenderer.CurrentExposure is adapting towards.
public float TargetExposure { get; }Property Value
float
TonemapScalar
Gets or sets the final linear tonemap scalar passed to the post-process shader.
public float TonemapScalar { get; set; }Property Value
float
Methods
CalculateTonemapScalar(float)
Updates PostProcessRenderer.TonemapScalar based on auto-exposure logic or PostProcessRenderer.CustomExposure.
public void CalculateTonemapScalar(float deltaTime)Parameters
deltaTime float
Elapsed time in seconds since the last frame, used for exposure adaptation speed.
Load(int)
Loads all post-processing shaders and initializes sub-renderers for the given MSAA sample count.
public void Load(int msaaSamples)Parameters
msaaSamples int
The MSAA sample count used to select shader variants.
Render(Framebuffer, Framebuffer, RenderTexture, Camera, bool)
Resolves MSAA, applies DOF/bloom, tonemaps, and writes the final LDR image to colorBufferDraw.
public void Render(Framebuffer colorBufferRead, Framebuffer colorBufferDraw, RenderTexture resolveTarget, Camera camera, bool flipY)Parameters
colorBufferRead Framebuffer
colorBufferDraw Framebuffer
resolveTarget RenderTexture
camera Camera
flipY bool
ResolveColorCorrection(List<WeightedLut>)
Resolves the frame's weighted color correction LUTs into PostProcessState.ColorCorrectionLUT. A single full-weight LUT passes through; anything else runs the combine compute shader, which weighs up to four LUTs and fills the remainder with the neutral LUT.
public void ResolveColorCorrection(List<WeightedLut> luts)Parameters
luts List<WeightedLut>
The LUTs contributing this frame with their blend weights.
ResolveMsaa(Framebuffer, RenderTexture, RenderTexture, bool, bool)
Resolves MSAA color and/or depth from source using compute shaders. Color and depth are written to standalone RenderTexture targets. Uses Karis average for HDR-aware color resolve, min filter for depth (conservative for reverse-Z).
public void ResolveMsaa(Framebuffer source, RenderTexture destColor, RenderTexture destDepth, bool resolveColor, bool resolveDepth)Parameters
source Framebuffer
destColor RenderTexture
destDepth RenderTexture
resolveColor bool
resolveDepth bool

