ProceduralSkyMaterial
A material that defines a simple sky for a Sky
resource.
class ProceduralSkyMaterial
ProceduralSkyMaterial
provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are defined by a main color, a color at the horizon, and an easing curve to interpolate between them. Suns are described by a position in the sky, a color, and a max angle from the sun at which the easing curve ends. The max angle therefore defines the size of the sun in the sky.
ProceduralSkyMaterial
supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four DirectionalLight3D
nodes in the scene. This means that the suns are defined individually by the properties of their corresponding DirectionalLight3D
s and globally by sunAngleMax
and sunCurve
.
ProceduralSkyMaterial
uses a lightweight shader to draw the sky and is therefore suited for real time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use PhysicalSkyMaterial
.
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 groundBottomColor: Color
Color of the ground at the bottom. Blends with
groundHorizonColor
.var groundCurve: Double
How quickly the
groundHorizonColor
fades into thegroundBottomColor
.var groundEnergyMultiplier: Double
Multiplier for ground color. A higher value will make the ground brighter.
var groundHorizonColor: Color
Color of the ground at the horizon. Blends with
groundBottomColor
.var skyCover: Texture2D?
The sky cover texture to use. This texture must use an equirectangular projection (similar to
PanoramaSkyMaterial
). The texture’s colors will be added to the existing sky color, and will be multiplied byskyEnergyMultiplier
andskyCoverModulate
. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look).var skyCoverModulate: Color
The tint to apply to the
skyCover
texture. This can be used to change the sky cover’s colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined inskyCover
.var skyCurve: Double
How quickly the
skyHorizonColor
fades into theskyTopColor
.var skyEnergyMultiplier: Double
Multiplier for sky color. A higher value will make the sky brighter.
var skyHorizonColor: Color
Color of the sky at the horizon. Blends with
skyTopColor
.var skyTopColor: Color
Color of the sky at the top. Blends with
skyHorizonColor
.var sunAngleMax: Double
Distance from center of sun where it fades out completely.
var sunCurve: Double
How quickly the sun fades away between the edge of the sun disk and
sunAngleMax
.var useDebanding: Bool
If
true
, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky.