Struct ProceduralSky
Type of Sky
that is generated procedurally based on user input parameters.
struct ProceduralSky
;
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. It is stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for real-time updates during gameplay. However, with a small enough texture size, it can still be updated relatively frequently, as it is updated on a background thread when multi-threading is available.
Properties
Name | Type | Description |
---|---|---|
groundBottomColor [get, set]
|
Color | Color of the ground at the bottom. |
groundCurve [get, set]
|
double | How quickly the groundHorizonColor fades into the groundBottomColor .
|
groundEnergy [get, set]
|
double | Amount of energy contribution from the ground. |
groundHorizonColor [get, set]
|
Color | Color of the ground at the horizon. |
skyCurve [get, set]
|
double | How quickly the skyHorizonColor fades into the skyTopColor .
|
skyEnergy [get, set]
|
double | Amount of energy contribution from the sky. |
skyHorizonColor [get, set]
|
Color | Color of the sky at the horizon. |
skyTopColor [get, set]
|
Color | Color of the sky at the top. |
sunAngleMax [get, set]
|
double | Distance from center of sun where it fades out completely. |
sunAngleMin [get, set]
|
double | Distance from sun where it goes from solid to starting to fade. |
sunColor [get, set]
|
Color | The sun's color. |
sunCurve [get, set]
|
double | How quickly the sun fades away between sunAngleMin and sunAngleMax .
|
sunEnergy [get, set]
|
double | Amount of energy contribution from the sun. |
sunLatitude [get, set]
|
double | The sun's height using polar coordinates. |
sunLongitude [get, set]
|
double | The direction of the sun using polar coordinates. |
textureSize [get, set]
|
ProceduralSky | Size of Texture that the ProceduralSky will generate. The size is set using texturesize .
|
Methods
Enums
Name | Description |
---|---|
Constants
|
|
TextureSize
|