DepthOfField class Rendering

Depth-of-field settings for a Scene (scene.depthOfField), disabled by default.

When enabled, out-of-focus geometry blurs with a bokeh look, driven by a thin-lens camera model. Focus is always focusDistance (world units, treated as meters by the lens math); the blur amount comes from the physical lens parameters (fStop, focalLength, sensorHeight) times the artistic blurScale. The bokeh's aperture shape is controlled with bladeCount, bladeRotation, and bladeCurvature.

The effect renders as half-resolution fragment passes on the linear HDR scene color before bloom, and forces the camera depth prepass while enabled. Translucent surfaces blur by the opaque depth behind them (the standard post-process depth-of-field caveat). Requires a perspective camera.

Constructors

DepthOfField()

Properties

bladeCount int
Aperture blade count shaping the bokeh. 0 (or anything below 3) keeps a perfect circle; 5..9 give the classic polygonal irises.
getter/setter pair
bladeCurvature double
How rounded the aperture polygon is. 1 is fully circular (the blade count stops mattering), 0 is a hard polygon.
getter/setter pair
bladeRotation double
Rotation of the aperture polygon in radians.
getter/setter pair
blurScale double
Artistic multiplier on the physically computed blur. 1 is physical.
getter/setter pair
enabled bool
Whether depth of field renders. Off by default; when off, the engine adds no passes and the feature costs nothing.
getter/setter pair
focalLength double
Lens focal length in meters (0.05 is a classic 50 mm). 0 (the default) derives it from the camera's vertical field of view and sensorHeight, so zooming the camera changes the blur physically.
getter/setter pair
focusDistance double
Distance to the focus plane in world units.
getter/setter pair
fStop double
The aperture f-number. Smaller stops (1.4, 2.8) give a shallower depth of field and larger bokeh; the aperture diameter is focalLength / fStop. Uses the same vocabulary as Scene.physicalCameraExposure so one set of camera numbers can drive exposure and blur.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
maxBackgroundBlur double
getter/setter pair
maxForegroundBlur double
Clamps on the blur radius, in half-resolution pixels, for the near and far fields. Larger values blur more but cost more and undersample sooner.
getter/setter pair
quality DepthOfFieldQuality
Gather quality tier; see DepthOfFieldQuality.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sensorHeight double
Simulated sensor height in meters. The default 0.024 is a full-frame 24 mm sensor.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited