ProceduralSkyMaterial

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsProceduralSkyMaterial() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsMaterial

func (self *Extension[T]) AsMaterial() Material.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsProceduralSkyMaterial

func (self *Extension[T]) AsProceduralSkyMaterial() Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.ProceduralSkyMaterial

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsMaterial

func (self Instance) AsMaterial() Material.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsProceduralSkyMaterial

func (self Instance) AsProceduralSkyMaterial() Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) EnergyMultiplier

func (self Instance) EnergyMultiplier() Float.X

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

func (Instance) GroundBottomColor

func (self Instance) GroundBottomColor() Color.RGBA

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

func (Instance) GroundCurve

func (self Instance) GroundCurve() Float.X

How quickly the GroundHorizonColor fades into the GroundBottomColor.

func (Instance) GroundEnergyMultiplier

func (self Instance) GroundEnergyMultiplier() Float.X

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

func (Instance) GroundHorizonColor

func (self Instance) GroundHorizonColor() Color.RGBA

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

func (Instance) ID

func (self Instance) ID() ID

func (Instance) SetEnergyMultiplier

func (self Instance) SetEnergyMultiplier(value Float.X)

SetEnergyMultiplier sets the property returned by [GetEnergyMultiplier].

func (Instance) SetGroundBottomColor

func (self Instance) SetGroundBottomColor(value Color.RGBA)

SetGroundBottomColor sets the property returned by [GetGroundBottomColor].

func (Instance) SetGroundCurve

func (self Instance) SetGroundCurve(value Float.X)

SetGroundCurve sets the property returned by [GetGroundCurve].

func (Instance) SetGroundEnergyMultiplier

func (self Instance) SetGroundEnergyMultiplier(value Float.X)

SetGroundEnergyMultiplier sets the property returned by [GetGroundEnergyMultiplier].

func (Instance) SetGroundHorizonColor

func (self Instance) SetGroundHorizonColor(value Color.RGBA)

SetGroundHorizonColor sets the property returned by [GetGroundHorizonColor].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetSkyCover

func (self Instance) SetSkyCover(value Texture2D.Instance)

SetSkyCover sets the property returned by [GetSkyCover].

func (Instance) SetSkyCoverModulate

func (self Instance) SetSkyCoverModulate(value Color.RGBA)

SetSkyCoverModulate sets the property returned by [GetSkyCoverModulate].

func (Instance) SetSkyCurve

func (self Instance) SetSkyCurve(value Float.X)

SetSkyCurve sets the property returned by [GetSkyCurve].

func (Instance) SetSkyEnergyMultiplier

func (self Instance) SetSkyEnergyMultiplier(value Float.X)

SetSkyEnergyMultiplier sets the property returned by [GetSkyEnergyMultiplier].

func (Instance) SetSkyHorizonColor

func (self Instance) SetSkyHorizonColor(value Color.RGBA)

SetSkyHorizonColor sets the property returned by [GetSkyHorizonColor].

func (Instance) SetSkyTopColor

func (self Instance) SetSkyTopColor(value Color.RGBA)

SetSkyTopColor sets the property returned by [GetSkyTopColor].

func (Instance) SetSunAngleMax

func (self Instance) SetSunAngleMax(value Angle.Radians)

SetSunAngleMax sets the property returned by [GetSunAngleMax].

func (Instance) SetSunCurve

func (self Instance) SetSunCurve(value Float.X)

SetSunCurve sets the property returned by [GetSunCurve].

func (Instance) SetUseDebanding

func (self Instance) SetUseDebanding(value bool)

SetUseDebanding sets the property returned by [GetUseDebanding].

func (Instance) SkyCover

func (self Instance) SkyCover() Texture2D.Instance

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

func (Instance) SkyCoverModulate

func (self Instance) SkyCoverModulate() Color.RGBA

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.

func (Instance) SkyCurve

func (self Instance) SkyCurve() Float.X

How quickly the SkyHorizonColor fades into the SkyTopColor.

func (Instance) SkyEnergyMultiplier

func (self Instance) SkyEnergyMultiplier() Float.X

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

func (Instance) SkyHorizonColor

func (self Instance) SkyHorizonColor() Color.RGBA

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

func (Instance) SkyTopColor

func (self Instance) SkyTopColor() Color.RGBA

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

func (Instance) SunAngleMax

func (self Instance) SunAngleMax() Angle.Radians

Distance from center of sun where it fades out completely.

func (Instance) SunCurve

func (self Instance) SunCurve() Float.X

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

func (Instance) UseDebanding

func (self Instance) 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.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL