Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
GIMode
GeometryInstance3D.swift:44enum GIMode
Cases
case disabled
Disabled global illumination mode. Use for dynamic objects that do not contribute to global illumination (such as characters). When using
VoxelGI
and SDFGI, the geometry will receive indirect lighting and reflections but the geometry will not be considered in GI baking. When usingLightmapGI
, the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.case `static`
Baked global illumination mode. Use for static objects that contribute to global illumination (such as level geometry). This GI mode is effective when using
VoxelGI
, SDFGI andLightmapGI
.case dynamic
Dynamic global illumination mode. Use for dynamic objects that contribute to global illumination. This GI mode is only effective when using
VoxelGI
, but it has a higher performance impact than .static
. When using other GI methods, this will act the same as .disabled.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (21) members.
Types
Type members
Instance members
var castShadow: GeometryInstance3D.ShadowCastingSetting
The selected shadow casting flag. See
ShadowCastingSetting
for possible values.var customAabb: AABB
Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive
AABB
recalculation that happens when a skeleton is used with aMeshInstance3D
or to have fine control over theMeshInstance3D
’s bounding box. To use the default AABB, set value to anAABB
with all fields set to0.0
. To avoid frustum culling, setcustomAabb
to a very large AABB that covers your entire game world such asAABB(-10000, -10000, -10000, 20000, 20000, 20000)
. To disable all forms of culling (including occlusion culling), callinstanceSetIgnoreCulling(instance:enabled:)
on theGeometryInstance3D
’sRID
.var extraCullMargin: Double
The extra distance added to the GeometryInstance3D’s bounding box (
AABB
) to increase its cull box.var giLightmapScale: GeometryInstance3D.LightmapScale
The texel density to use for lightmapping in
LightmapGI
. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes.var giMode: GeometryInstance3D.GIMode
The global illumination mode to use for the whole geometry. To avoid inconsistent results, use a mode that matches the purpose of the mesh during gameplay (static/dynamic).
var ignoreOcclusionCulling: Bool
If
true
, disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use.var lodBias: Double
Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances.
var materialOverlay: Material?
The material overlay for the whole geometry.
var materialOverride: Material?
The material override for the whole geometry.
var transparency: Double
The transparency applied to the whole geometry (as a multiplier of the materials’ existing transparency).
0.0
is fully opaque, while1.0
is fully transparent. Values greater than0.0
(exclusive) will force the geometry’s materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, settingtransparency
to a value greater than0.0
(exclusive) will not disable shadow rendering.var visibilityRangeBegin: Double
Starting distance from which the GeometryInstance3D will be visible, taking
visibilityRangeBeginMargin
into account as well. The default value of 0 is used to disable the range check.var visibilityRangeBeginMargin: Double
Margin for the
visibilityRangeBegin
threshold. The GeometryInstance3D will only change its visibility state when it goes over or under thevisibilityRangeBegin
threshold by this amount.var visibilityRangeEnd: Double
Distance from which the GeometryInstance3D will be hidden, taking
visibilityRangeEndMargin
into account as well. The default value of 0 is used to disable the range check.var visibilityRangeEndMargin: Double
Margin for the
visibilityRangeEnd
threshold. The GeometryInstance3D will only change its visibility state when it goes over or under thevisibilityRangeEnd
threshold by this amount.var visibilityRangeFadeMode: GeometryInstance3D.VisibilityRangeFadeMode
Controls which instances will be faded when approaching the limits of the visibility range. See
VisibilityRangeFadeMode
for possible values.func getInstanceShaderParameter(name: StringName
) -> Variant Get the value of a shader parameter as set on this instance.
func setInstanceShaderParameter(name: StringName, value: Variant
) Set the value of a shader uniform for this instance only (per-instance uniform). See also
setShaderParameter(param:value:)
to assign a uniform on all instances using the sameShaderMaterial
.
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.