Table of Contents

Class ProceduralSkyMaterial

Namespace
Godot
Assembly
GodotSharp.dll

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 DirectionalLight3Ds 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.

public class ProceduralSkyMaterial : Material, IDisposable
Inheritance
ProceduralSkyMaterial
Implements
Inherited Members

Constructors

ProceduralSkyMaterial()

public ProceduralSkyMaterial()

Properties

GroundBottomColor

Color of the ground at the bottom. Blends with GroundHorizonColor.

public Color GroundBottomColor { get; set; }

Property Value

Color

GroundCurve

How quickly the GroundHorizonColor fades into the GroundBottomColor.

public float GroundCurve { get; set; }

Property Value

float

GroundEnergyMultiplier

Multiplier for ground color. A higher value will make the ground brighter.

public float GroundEnergyMultiplier { get; set; }

Property Value

float

GroundHorizonColor

Color of the ground at the horizon. Blends with GroundBottomColor.

public Color GroundHorizonColor { get; set; }

Property Value

Color

SkyCover

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 by SkyEnergyMultiplier and SkyCoverModulate. 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).

public Texture2D SkyCover { get; set; }

Property Value

Texture2D

SkyCoverModulate

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 in SkyCover.

public Color SkyCoverModulate { get; set; }

Property Value

Color

SkyCurve

How quickly the SkyHorizonColor fades into the SkyTopColor.

public float SkyCurve { get; set; }

Property Value

float

SkyEnergyMultiplier

Multiplier for sky color. A higher value will make the sky brighter.

public float SkyEnergyMultiplier { get; set; }

Property Value

float

SkyHorizonColor

Color of the sky at the horizon. Blends with SkyTopColor.

public Color SkyHorizonColor { get; set; }

Property Value

Color

SkyTopColor

Color of the sky at the top. Blends with SkyHorizonColor.

public Color SkyTopColor { get; set; }

Property Value

Color

SunAngleMax

Distance from center of sun where it fades out completely.

public float SunAngleMax { get; set; }

Property Value

float

SunCurve

How quickly the sun fades away between the edge of the sun disk and SunAngleMax.

public float SunCurve { get; set; }

Property Value

float

UseDebanding

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.

public bool UseDebanding { get; set; }

Property Value

bool

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool