Vixen
02b45cc4
csharp
public sealed class LocalExposureRenderer

One exposure per region of the frame rather than one for the whole of it.

Read the guide page for this →

Remarks

The thing a single exposure cannot do. A frame with a sunlit window and an unlit interior has ten or twelve stops between the two and a tone curve has about six to spend, so whatever the meter picks, one of them is white or black. That is what a camera does and what an eye does not, because an eye adapts locally. Unreal 5 ships this and calls it Local Exposure; it is the one effect on their list with no Unity counterpart at all.

Two passes, because the base has to exist before it can be applied. The first blurs the log luminance bilaterally into a quarter-resolution target; the second reads that back at full resolution and re-composes. A fragment stage cannot write a texture it is also reading, so this is a chain rather than a pass — the same shape BloomRenderer has and for the same reason.

⚠ Quarter resolution for the base, and that is a decision rather than a saving. The base is the large-scale brightness of a region by definition; computing it at full resolution would let it follow detail, which is exactly what it must not do. It also makes the bilateral cross reach four times as far across the image for the same tap count.

⚠ Before the tonemap. It moves radiance around before the curve shapes it, which is the point — the whole purpose is to bring highlights into the range the curve can spend. After the curve there is nothing left to recover.

Fields and properties (18)

  • public required string Source

    The linear HDR colour it re-exposes.

  • public string Output

    The name the result is published under.

  • public PixelFormat Format

    The format of the target it declares.

  • public int Taps

    How many taps the bilateral blur uses along each axis of its cross.

  • public float BlurRadius

    How far the bilateral gather reaches, in texels of the reduced image.

  • public float EdgeRange

    How different two luminances have to be, in stops, before a tap stops counting.

  • public float HighlightContrast

    How much the highlights are brought down. 0 is off.

  • public float ShadowContrast

    And how much the shadows are brought up.

  • public float MaximumStops

    A ceiling on how far any pixel may move, in stops.

  • public float Ev100

    The exposure the frame will be graded at, which is what the compression pivots around.

  • public RenderView? View

    The view whose lens supplies the exposure value, or null for Ev100.

  • public EffectPipelineDescriber? Modules

    Where shader modules come from.

  • public DescriptorAllocator? Descriptors

    Where descriptor sets come from.

  • public SamplerCache? Samplers

    Where the samplers come from.

  • public IGraphicsDevice? Device

    The device its pipelines and uniform buffers are created on.

  • public int PassCount

    How many passes the last build declared.

  • public IReadOnlyList<FullScreenRenderer> Passes

    The chain's passes, for a test or an inspector.

  • public float Pivot

    The log-2 luminance the compression pivots around.

Methods (3)

  • public void Apply(in PostProcessOverlay overlay)
  • protected override void Build(GraphicsCompositor compositor, CompositorFrame frame)

    Declares this node's render-graph passes.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (2)

  • PostEffectFactoryVixen.Rendering.PostFx
  • PostEffectTestsVixen.Rendering.PostFx.Tests