public sealed class LightStreakRendererThe anamorphic smear a bright highlight gets, which bloom cannot produce.
Remarks
Not bloom with a direction. Bloom is isotropic because the scatter it models is: light spreading a short way in every direction from where it landed. A streak comes from an aperture that is not round — an anamorphic lens squeezes a wide image onto a normal frame with a cylindrical element, so what diffracts and scatters inside it is stretched along one axis. No radius of an isotropic blur is that shape.
Three kinds of pass, and the middle one runs several times. A threshold into a reduced target, then BlurPasses separable blurs along Direction, then a composite that adds the result onto the scene. The blurs ping-pong between two planes of the same size and each one's stride is (2·Samples + 1) times the last, so three passes of four taps reach 729 texels for the cost of 27 samples rather than 729.
⚠ Each pass steps in its source's texel grid, not the frame's. The bright plane is at Scale of the frame, so a stride measured in the frame's texels would be a fraction of a texel and every tap would land back where it started — a streak subtly too short and too soft, which no screenshot answers. It is the mistake the bloom chain records having made, and TexelSize is set per pass from the plane that pass reads for that reason.
⚠ Before the tonemap, like LensFlareRenderer. A streak is light arriving at the sensor and has to be able to blow out; added after the curve it is a wash over the picture.
⚠ Threshold is in the source's units. In a physically lit frame that is cd/m² and nothing is near one, so the default of one would streak the floor — the same argument !Bloom's threshold makes and the same failure if it is left alone.
Fields and properties (17)
public required string SourceThe linear HDR colour the streak is built from and added onto.
public string OutputThe name the result is published under.
public PixelFormat FormatThe format of the targets it declares.
public float ScaleThe fraction of the frame the streak is built at.
public float ThresholdLuminance above which a pixel streaks, in the source's units.
public int BlurPassesHow many blur passes run, each reaching further than the last.
public int SamplesHow many taps each side of the centre one blur pass takes.
public Vector2 DirectionThe axis the smear runs along, in UV. Normalised before it reaches the shader.
public float AttenuationHow fast a tap fades per texel of separation. Below one, or the streak never ends.
public float IntensityHow bright the finished streak is added back.
public Vector3 TintA tint on the streak, for the blue a coated anamorphic element is known for.
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.
Methods (3)
public void Apply(in PostProcessOverlay overlay)protected override void Build(GraphicsCompositor compositor, CompositorFrame frame)public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (2)
- LightStreakImageTestsVixen.Graphics.Golden.Tests
- PostEffectFactoryVixen.Rendering.PostFx