Table of Contents

Class PhysicalSkyMaterial

Namespace
Godot
Assembly
GodotSharp.dll

The PhysicalSkyMaterial uses the Preetham analytic daylight model to draw a sky based on physical properties. This results in a substantially more realistic sky than the ProceduralSkyMaterial, but it is slightly slower and less flexible.

The PhysicalSkyMaterial only supports one sun. The color, energy, and direction of the sun are taken from the first DirectionalLight3D in the scene tree.

As it is based on a daylight model, the sky fades to black as the sunset ends. If you want a full day/night cycle, you will have to add a night sky by converting this to a ShaderMaterial and adding a night sky directly into the resulting shader.

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

Constructors

PhysicalSkyMaterial()

public PhysicalSkyMaterial()

Properties

EnergyMultiplier

The sky's overall brightness multiplier. Higher values result in a brighter sky.

public float EnergyMultiplier { get; set; }

Property Value

float

GroundColor

Modulates the Color on the bottom half of the sky to represent the ground.

public Color GroundColor { get; set; }

Property Value

Color

MieCoefficient

Controls the strength of Mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon.

public float MieCoefficient { get; set; }

Property Value

float

MieColor

Controls the Color of the Mie scattering effect. While not physically accurate, this allows for the creation of alien-looking planets.

public Color MieColor { get; set; }

Property Value

Color

MieEccentricity

Controls the direction of the Mie scattering. A value of 1 means that when light hits a particle it's passing through straight forward. A value of -1 means that all light is scatter backwards.

public float MieEccentricity { get; set; }

Property Value

float

NightSky

Texture2D for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day.

public Texture2D NightSky { get; set; }

Property Value

Texture2D

RayleighCoefficient

Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.

public float RayleighCoefficient { get; set; }

Property Value

float

RayleighColor

Controls the Color of the Rayleigh scattering. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red Color results in a Mars-looking atmosphere with a corresponding blue sunset.

public Color RayleighColor { get; set; }

Property Value

Color

SunDiskScale

Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth.

public float SunDiskScale { get; set; }

Property Value

float

Turbidity

Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere.

public float Turbidity { 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