CameraAttributesPhysical
Physically-based camera settings.
CameraAttributesPhysical.swift:18class CameraAttributesPhysical
CameraAttributesPhysical
is used to set rendering settings based on a physically-based camera’s settings. It is responsible for exposure, auto-exposure, and depth of field.
When used in a WorldEnvironment
it provides default settings for exposure, auto-exposure, and depth of field that will be used by all cameras without their own CameraAttributes
, including the editor camera. When used in a Camera3D
it will override any CameraAttributes
set in the WorldEnvironment
and will override the Camera3D
s far
, near
, fov
, and keepAspect
properties. When used in VoxelGI
or LightmapGI
, only the exposure settings will be used.
The default settings are intended for use in an outdoor environment, tips for settings for use in an indoor environment can be found in each setting’s documentation.
Superclasses
class CameraAttributes
Parent class for camera settings.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var autoExposureMaxExposureValue: Double
The maximum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright.
var autoExposureMinExposureValue: Double
The minimum luminance luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark.
var exposureAperture: Double
Size of the aperture of the camera, measured in f-stops. An f-stop is a unitless ratio between the focal length of the camera and the diameter of the aperture. A high aperture setting will result in a smaller aperture which leads to a dimmer image and sharper focus. A low aperture results in a wide aperture which lets in more light resulting in a brighter, less-focused image. Default is appropriate for outdoors at daytime (i.e. for use with a default
DirectionalLight3D
), for indoor lighting, a value between 2 and 4 is more appropriate.var exposureShutterSpeed: Double
Time for shutter to open and close, measured in seconds. A higher value will let in more light leading to a brighter image, while a lower amount will let in less light leading to a darker image.
var frustumFar: Double
Override value for
far
. Used internally when calculating depth of field. When attached to aCamera3D
as itsattributes
, it will override thefar
property.var frustumFocalLength: Double
Distance between camera lens and camera aperture, measured in millimeters. Controls field of view and depth of field. A larger focal length will result in a smaller field of view and a narrower depth of field meaning fewer objects will be in focus. A smaller focal length will result in a wider field of view and a larger depth of field meaning more objects will be in focus. When attached to a
Camera3D
as itsattributes
, it will override thefov
property and thekeepAspect
property.var frustumFocusDistance: Double
Distance from camera of object that will be in focus, measured in meters. Internally this will be clamped to be at least 1 millimeter larger than
frustumFocalLength
.var frustumNear: Double
Override value for
near
. Used internally when calculating depth of field. When attached to aCamera3D
as itsattributes
, it will override thenear
property.func getFov(
) -> Double Returns the vertical field of view that corresponds to the
frustumFocalLength
. This value is calculated internally wheneverfrustumFocalLength
is changed.