Vixen
02b45cc4
csharp
public sealed class VignetteRenderer

The lens: vignette, chromatic aberration and grain, in one pass because they are one look.

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

Remarks

Three effects rather than one, each behind its own permutation, so a frame that wants only grain emits only grain. Together at the end of the chain because all three are what a camera does to an image rather than what a scene does to light — and because each is one or two taps, where three passes would be three full-screen reads of an HDR target.

Fields and properties (19)

  • public required string Source

    The texture it darkens, tints and grains.

  • public bool UseVignette

    Whether the corners are darkened.

  • public bool UseChromaticAberration

    Whether the channels are offset toward the edges.

  • public bool UseGrain

    Whether film grain is added.

  • public bool LuminanceWeightedGrain

    Whether grain is scaled by luminance, which is what film actually does.

  • public bool UseLensDistortion

    Whether the image is warped radially before anything else reads it.

  • public Vector3 VignetteColour

    What colour the corners go towards.

  • public Vector2 VignetteCentre

    Where the vignette is centred, in UV.

  • public float VignetteRoundness

    0 follows the aspect ratio, 1 is a circle whatever shape the screen is.

  • public float DistortionIntensity

    How far the image is pushed out (positive) or pulled in (negative) at the edges.

  • public Vector2 DistortionScale

    Per-axis multipliers, so one axis can be left undistorted.

  • public Vector2 DistortionCentre

    Where the distortion is centred, in UV.

  • public float DistortionZoom

    A zoom applied after the warp, to hide the border a positive distortion pulls in.

  • public float VignetteIntensity

    How dark the corners go.

  • public float VignetteSmoothness

    How gradually the vignette comes on.

  • public float AberrationStrength

    How far the channels separate at the edge of the frame.

  • public float GrainIntensity

    How much grain is added.

  • public float GrainScale

    How large the grain is.

  • public float FrameIndex

    Which frame this is, so the grain moves.

Methods (3)

Used by (2)

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