Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
ShadowMode
DirectionalLight3D.swift:13enum ShadowMode
Cases
case orthogonal
Renders the entire scene’s shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects.
case parallel2Splits
Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between .shadowOrthogonal and .shadowParallel4Splits in terms of performance.
case parallel4Splits
Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (11) members.
Types
Type members
Instance members
var directionalShadowBlendSplits: Bool
If
true
, shadow detail is sacrificed in exchange for smoother transitions between splits. Enabling shadow blend splitting also has a moderate performance cost. This is ignored whendirectionalShadowMode
is .shadowOrthogonal.var directionalShadowFadeStart: Double
Proportion of
directionalShadowMaxDistance
at which point the shadow starts to fade. AtdirectionalShadowMaxDistance
, the shadow will disappear. The default value is a balance between smooth fading and distant shadow visibility. If the camera moves fast and thedirectionalShadowMaxDistance
is low, consider loweringdirectionalShadowFadeStart
below0.8
to make shadow transitions less noticeable. On the other hand, if you tuneddirectionalShadowMaxDistance
to cover the entire scene, you can setdirectionalShadowFadeStart
to1.0
to prevent the shadow from fading in the distance (it will suddenly cut off instead).var directionalShadowMaxDistance: Double
The maximum distance for shadow splits. Increasing this value will make directional shadows visible from further away, at the cost of lower overall shadow detail and performance (since more objects need to be included in the directional shadow rendering).
var directionalShadowMode: DirectionalLight3D.ShadowMode
The light’s shadow rendering algorithm. See
ShadowMode
.var directionalShadowPancakeSize: Double
Sets the size of the directional shadow pancake. The pancake offsets the start of the shadow’s camera frustum to provide a higher effective depth resolution for the shadow. However, a high pancake size can cause artifacts in the shadows of large objects that are close to the edge of the frustum. Reducing the pancake size can help. Setting the size to
0
turns off the pancaking effect.var directionalShadowSplit1: Double
The distance from camera to shadow split 1. Relative to
directionalShadowMaxDistance
. Only used whendirectionalShadowMode
is .shadowParallel2Splits or .shadowParallel4Splits.var directionalShadowSplit2: Double
The distance from shadow split 1 to split 2. Relative to
directionalShadowMaxDistance
. Only used whendirectionalShadowMode
is .shadowParallel4Splits.var directionalShadowSplit3: Double
The distance from shadow split 2 to split 3. Relative to
directionalShadowMaxDistance
. Only used whendirectionalShadowMode
is .shadowParallel4Splits.var skyMode: DirectionalLight3D.SkyMode
Set whether this
DirectionalLight3D
is visible in the sky, in the scene, or both in the sky and in the scene. SeeSkyMode
for options.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.