Scripting API

Scripting API

CameraDepthOfField

Record struct in Abyss.Core, from Abyss.Core.

A camera's depth of field: what is CameraDepthOfField.FocalDistance away is sharp, and nearer and farther blurs, as through a lens — the more, the lower its CameraDepthOfField.ApertureFStops. Bevy's DepthOfField, field for field. A perspective camera's alone, and not drawn in WebGL2.

public readonly record struct CameraDepthOfField

Remarks

Laid out as abyss_core::post::CameraDepthOfField is, 24 bytes.

Constructors

CameraDepthOfField

public CameraDepthOfField(DepthOfFieldMode Mode, float FocalDistance, float SensorHeight, float ApertureFStops, float MaxCircleOfConfusionDiameter, float MaxDepth)

A camera's depth of field: what is CameraDepthOfField.FocalDistance away is sharp, and nearer and farther blurs, as through a lens — the more, the lower its CameraDepthOfField.ApertureFStops. Bevy's DepthOfField, field for field. A perspective camera's alone, and not drawn in WebGL2.

Parameters

  • Mode: How it blurs.
  • FocalDistance: How far away what is sharp is, in meters, more than nothing.
  • SensorHeight: The height of the camera's sensor, in meters, which with the field of view is its focal length: 0.01866, a film camera's, is Bevy's.
  • ApertureFStops: The lens's f-number, more than nothing: the lower, the less is sharp.
  • MaxCircleOfConfusionDiameter: The widest a blur is, in pixels, nothing or more.
  • MaxDepth: The farthest anything counts as, in meters, more than nothing or infinity: where the sky is, which is farther than anything.

Laid out as abyss_core::post::CameraDepthOfField is, 24 bytes.

Properties

Mode

public DepthOfFieldMode Mode { get; init; }

How it blurs.

FocalDistance

public float FocalDistance { get; init; }

How far away what is sharp is, in meters, more than nothing.

SensorHeight

public float SensorHeight { get; init; }

The height of the camera's sensor, in meters, which with the field of view is its focal length: 0.01866, a film camera's, is Bevy's.

ApertureFStops

public float ApertureFStops { get; init; }

The lens's f-number, more than nothing: the lower, the less is sharp.

MaxCircleOfConfusionDiameter

public float MaxCircleOfConfusionDiameter { get; init; }

The widest a blur is, in pixels, nothing or more.

MaxDepth

public float MaxDepth { get; init; }

The farthest anything counts as, in meters, more than nothing or infinity: where the sky is, which is farther than anything.

Methods

Focused

public static CameraDepthOfField Focused(float distance, float fStops = 1, DepthOfFieldMode mode = Gaussian, float farthest = Infinity)

Sharp at distance meters through a lens of fStops, on Bevy's film sensor, blurring at most 64 pixels, the sky as far as farthest.

Parameters

  • distance
  • fStops
  • mode
  • farthest