public sealed class DepthOfFieldRendererDefocus, taken from the lens the frame is exposed through.
Remarks
Every number here comes off the view's Camera, and that is the point. A lens has one aperture: opening it brightens the image and shortens the depth of field together. Both Unreal and HDRP offer a physical camera mode for the same reason, and both also offer a manual one — this has only the physical, because the manual one is what lets an author write a camera that cannot exist and then wonder why the blur and the brightness disagree.
⚠ A frame with no lens is a frame with no defocus, not a frame with a default one. `Camera.HasLens` false, or a focus distance of zero, leaves every pixel sharp — which is what focusing at infinity means and what a project that has not asked for this should get.
⚠ It runs before the tonemap. Defocus is the lens spreading light across the sensor, which is scene-referred: a blurred highlight has to keep its energy so that averaging it with a dark neighbour gives the bright smear a lens gives, and after the curve it would give a grey one. It also has to run before !Bloom reads the image, or the glow is built from highlights the lens never focused there.
Fields and properties (6)
public required string SourceThe scene colour it defocuses.
public required string DepthThe depth every pixel's distance is read from.
public RenderView? ViewThe view whose camera carries the lens.
public int SamplesHow many samples the disc is gathered with.
public bool UseBladeShapeWhether the bokeh takes the diaphragm's polygon rather than a circle.
public float MaximumRadiusHow wide the blur may get, in pixels.
Methods (3)
public DepthOfFieldRenderer()Defocus, taken from the lens the frame is exposed through.
public void Apply(in PostProcessOverlay overlay)protected override void Configure(CompositorFrame frame, ParameterCollection parameters, IList<ResourceBinding> bindings)Fills in this frame's parameters and bindings.
Used by (2)
- PostEffectFactoryVixen.Rendering.PostFx
- PostEffectTestsVixen.Rendering.PostFx.Tests