public sealed class LensFlareRendererWhat a bright source does to the rest of the frame, rather than to its own pixels.
Remarks
Not bloom with a different name. Bloom is light scattered a short way from where it landed. A flare is light that reflected off the back of one lens element and the front of another, so it lands somewhere else entirely — and where it lands is not arbitrary. A ghost of a highlight sits on the line from that highlight through the centre of the frame, at a distance set by which pair of elements it bounced between, which is why the whole effect is one vector and a list of scale factors.
Two passes. A threshold into a quarter-resolution target, then a gather that adds the ghosts, the halo and the starburst onto the scene. A full-resolution gather over a dozen ghosts is a dozen dependent reads per pixel of an image that is mostly black.
⚠ Before the tonemap and before !Bloom. A flare is light arriving at the sensor, so it has to be able to blow out. Added after the curve it could only ever be a wash over the picture, and a highlight already at white would gain a ghost brighter than itself.
⚠ Threshold is in the source's units. In a physically lit frame that is cd/m² and nothing is near one, so the usual value of one would flare the floor. The same argument !Bloom's threshold makes, and the same failure if it is left at the default.
Fields and properties (25)
public required string SourceThe linear HDR colour the flare is built from and added onto.
public string OutputThe name the result is published under.
public PixelFormat FormatThe format of the target it declares.
public float ThresholdLuminance above which a pixel contributes to a flare.
public int GhostsHow many ghosts are traced along the centre vector.
public float GhostSpacingHow far apart consecutive ghosts are, as a fraction of the vector to the centre.
public float GhostIntensityHow bright the ghosts are.
public bool UseHaloWhether the halo ring is drawn.
public float HaloRadiusHow far out the halo ring sits, in UV.
public float HaloThicknessHow thick it is.
public float HaloIntensityHow bright it is.
public float ChromaticOffsetHow far the three channels are sampled apart, in UV. Zero is no fringing.
public bool UseStarburstWhether the diaphragm's diffraction spikes are drawn.
public float StarburstBladesHow many diffraction spikes.
public float StarburstIntensityHow strongly the spikes modulate the ghosts.
public float StarburstAngleA rotation on the spike pattern, in radians.
public Vector3 TintA tint on the whole flare, for a lens with a coloured coating.
public RenderView? ViewThe view whose lens supplies the blade count, or null for StarburstBlades.
public EffectPipelineDescriber? ModulesWhere shader modules come from.
public DescriptorAllocator? DescriptorsWhere descriptor sets come from.
public SamplerCache? SamplersWhere the samplers come from.
public IGraphicsDevice? DeviceThe device its pipelines and uniform buffers are created on.
public int PassCountHow many passes the last build declared.
public IReadOnlyList<FullScreenRenderer> PassesThe chain's passes, for a test or an inspector.
public float BladesHow many blades the spikes are drawn for.
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