FogMaterial
A material that controls how volumetric fog is rendered, to be assigned to a FogVolume
.
class FogMaterial
A Material
resource that can be used by FogVolume
s to draw volumetric effects.
If you need more advanced effects, use a custom fog shader.
Superclasses
class Material
Virtual base class for applying visual properties to an object, such as color and roughness.
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 albedo: Color
The single-scattering
Color
of theFogVolume
. Internally,albedo
is converted into single-scattering, which is additively blended with otherFogVolume
s and thevolumetricFogAlbedo
.var density: Double
The density of the
FogVolume
. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from otherFogVolume
s or global volumetric fog.var densityTexture: Texture3D?
The 3D texture that is used to scale the
density
of theFogVolume
. This can be used to vary fog density within theFogVolume
with any kind of static pattern. For animated effects, consider using a custom fog shader.var edgeFade: Double
The hardness of the edges of the
FogVolume
. A higher value will result in softer edges, while a lower value will result in harder edges.var emission: Color
The
Color
of the light emitted by theFogVolume
. Emitted light will not cast light or shadows on other objects, but can be useful for modulating theColor
of theFogVolume
independently from light sources.var heightFalloff: Double
The rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of
0.0
results in uniform-density fog. The height threshold is determined by the height of the associatedFogVolume
.