Vixen
02b45cc4
csharp
public sealed class TonemapRenderer

The pass every frame ends with: linear HDR in, displayable colour out.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Everything upstream works in linear radiance with no upper bound, because that is what light is and what makes exposure, bloom and additive lighting compose correctly. A display takes neither of those things, so something has to map an unbounded range onto zero to one and encode it — and doing it anywhere but the end means every effect after it works on numbers that have already been squashed.

It ran before this existed, and that is the point of the change. Tonemap.rvn has been the worked example for the full-screen node since the node was written, configured by hand wherever a frame needed one — a shader name, five parameter keys and three bindings, spelled out per host. As an effect it is one line in a document like every other, and the grading LUT the shader has always taken finally has something that binds one.

Fields and properties (31)

  • public required string Source

    The linear HDR colour it maps.

  • public string Lut

    A 3D colour lookup table, or empty for none.

  • public int Operator

    Which curve maps the range: 0 Reinhard, 1 ACES, 2 AgX, 3 filmic, 4 none.

  • public bool EncodeSrgb

    Whether the result is encoded to sRGB here rather than by the swapchain.

  • public float Exposure

    What the scene's radiance is multiplied by before the curve.

  • public string ExposureBuffer

    The buffer AutoExposure left this frame's measured exposure in, or empty to use Exposure.

  • public string Bloom

    The bloom pyramid to add before the curve, or empty for a frame with no glow.

  • public float BloomIntensity

    How much of the pyramid reaches the image.

  • public Vector3 BloomTint

    What colour the spill is — the coating on the lens rather than the light.

  • public string BloomDirt

    Dust and smears on the front element, or empty for a clean lens.

  • public float BloomDirtIntensity

    How much the dirt brightens the bloom.

  • public ColorGrading? Grading

    The four-range colour decision list, or null for no grade.

  • public RenderView? View

    The view whose lens sets the exposure, or null for an authored one.

  • public bool LensExposure

    Whether the view's lens supplies the exposure, because nothing else did.

  • public float WhitePoint

    The radiance that maps to white.

  • public float Contrast

    Contrast, applied around middle grey.

  • public float Saturation

    Saturation, 0 for greyscale.

  • public float Temperature

    The colour temperature the scene is lit at, in kelvin, or zero to leave it alone.

  • public float Tint

    Green to magenta, −1 to 1. The axis a colour temperature does not have.

  • public Vector3 ColorFilter

    Multiplied into the scene before anything else grades it.

  • public float HueShift

    Hue rotation in radians.

  • public float SplitBalance

    Where split toning crosses over, −1 towards shadows and 1 towards highlights.

  • public float FilmicShoulderStrength

    Hable's shoulder strength. Read when Operator is 3.

  • public float FilmicLinearStrength

    Hable's linear strength.

  • public float FilmicLinearAngle

    Hable's linear angle.

  • public float FilmicToeStrength

    Hable's toe strength.

  • public float FilmicToeNumerator

    Hable's toe numerator.

  • public float FilmicToeDenominator

    Hable's toe denominator.

  • public Vector3 ShadowTint

    What the shadows are tinted toward.

  • public Vector3 HighlightTint

    What the highlights are tinted toward.

  • public float LutSize

    How many entries the LUT has along one axis.

Methods (3)

Used by (4)

  • AutoExposureTestsVixen.Rendering.PostFx.Tests
  • HarnessVixen.Rendering.PostFx.Tests
  • PostEffectFactoryVixen.Rendering.PostFx
  • PostEffectTestsVixen.Rendering.PostFx.Tests