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

NameTypeDescription
groundBottomColor[get, set] ColorColor of the ground at the bottom.
groundCurve[get, set] doubleHow quickly the groundHorizonColor fades into the groundBottomColor.
groundEnergy[get, set] doubleAmount of energy contribution from the ground.
groundHorizonColor[get, set] ColorColor of the ground at the horizon.
skyCurve[get, set] doubleHow quickly the skyHorizonColor fades into the skyTopColor.
skyEnergy[get, set] doubleAmount of energy contribution from the sky.
skyHorizonColor[get, set] ColorColor of the sky at the horizon.
skyTopColor[get, set] ColorColor of the sky at the top.
sunAngleMax[get, set] doubleDistance from center of sun where it fades out completely.
sunAngleMin[get, set] doubleDistance from sun where it goes from solid to starting to fade.
sunColor[get, set] ColorThe sun's color.
sunCurve[get, set] doubleHow quickly the sun fades away between sunAngleMin and sunAngleMax.
sunEnergy[get, set] doubleAmount of energy contribution from the sun.
sunLatitude[get, set] doubleThe sun's height using polar coordinates.
sunLongitude[get, set] doubleThe direction of the sun using polar coordinates.
textureSize[get, set] ProceduralSky.TextureSizeSize of Texture that the ProceduralSky will generate. The size is set using texturesize.

Methods

NameDescription
_threadDone
_updateSky
getGroundBottomColor
getGroundCurve
getGroundEnergy
getGroundHorizonColor
getSkyCurve
getSkyEnergy
getSkyHorizonColor
getSkyTopColor
getSunAngleMax
getSunAngleMin
getSunColor
getSunCurve
getSunEnergy
getSunLatitude
getSunLongitude
getTextureSize
setGroundBottomColor
setGroundCurve
setGroundEnergy
setGroundHorizonColor
setSkyCurve
setSkyEnergy
setSkyHorizonColor
setSkyTopColor
setSunAngleMax
setSunAngleMin
setSunColor
setSunCurve
setSunEnergy
setSunLatitude
setSunLongitude
setTextureSize

Enums

NameDescription
Constants
TextureSize