W3cubDocs

/Godot 3.1

ProceduralSky

Inherits: Sky < Resource < Reference < Object

Category: Core

Brief Description

Type of Sky that is generated procedurally based on user input parameters.

Properties

Color ground_bottom_color
float ground_curve
float ground_energy
Color ground_horizon_color
float sky_curve
float sky_energy
Color sky_horizon_color
Color sky_top_color
float sun_angle_max
float sun_angle_min
Color sun_color
float sun_curve
float sun_energy
float sun_latitude
float sun_longitude
TextureSize texture_size

Enumerations

enum TextureSize:

  • TEXTURE_SIZE_256 = 0
  • TEXTURE_SIZE_512 = 1
  • TEXTURE_SIZE_1024 = 2
  • TEXTURE_SIZE_2048 = 3
  • TEXTURE_SIZE_4096 = 4
  • TEXTURE_SIZE_MAX = 5 — Represents the size of the TextureSize enum.

Description

ProceduralSky 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 very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky.

The ProceduralSky is updated on the CPU after the parameters change and stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for realtime updates during gameplay. But with a small texture size it is still feasible to update relatively frequently because it is updated on a background thread when multi-threading is available.

Property Descriptions

Color ground_bottom_color

Setter set_ground_bottom_color(value)
Getter get_ground_bottom_color()

Color of the ground at the bottom.

float ground_curve

Setter set_ground_curve(value)
Getter get_ground_curve()

How quickly the ground_horizon_color fades into the ground_bottom_color.

float ground_energy

Setter set_ground_energy(value)
Getter get_ground_energy()

Amount of energy contribution from the ground.

Color ground_horizon_color

Setter set_ground_horizon_color(value)
Getter get_ground_horizon_color()

Color of the ground at the horizon.

float sky_curve

Setter set_sky_curve(value)
Getter get_sky_curve()

How quickly the sky_horizon_color fades into the sky_top_color.

float sky_energy

Setter set_sky_energy(value)
Getter get_sky_energy()

Amount of energy contribution from the sky.

Color sky_horizon_color

Setter set_sky_horizon_color(value)
Getter get_sky_horizon_color()

Color of the sky at the horizon.

Color sky_top_color

Setter set_sky_top_color(value)
Getter get_sky_top_color()

Color of the sky at the top.

float sun_angle_max

Setter set_sun_angle_max(value)
Getter get_sun_angle_max()

Distance from center of sun where it fades out completely.

float sun_angle_min

Setter set_sun_angle_min(value)
Getter get_sun_angle_min()

Distance from sun where it goes from solid to starting to fade.

Color sun_color

Setter set_sun_color(value)
Getter get_sun_color()

Color of the sun.

float sun_curve

Setter set_sun_curve(value)
Getter get_sun_curve()

How quickly the sun fades away between sun_angle_min and sun_angle_max.

float sun_energy

Setter set_sun_energy(value)
Getter get_sun_energy()

Amount of energy contribution from the sun.

float sun_latitude

Setter set_sun_latitude(value)
Getter get_sun_latitude()

The suns height using polar coordinates.

float sun_longitude

Setter set_sun_longitude(value)
Getter get_sun_longitude()

The direction of the sun using polar coordinates.

TextureSize texture_size

Setter set_texture_size(value)
Getter get_texture_size()

Size of Texture that the ProceduralSky will generate. The size is set using TextureSize.

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_proceduralsky.html