summaryrefslogtreecommitdiff
path: root/doc/classes/ProceduralSky.xml
blob: 9ffca20081a15cb91a3a7e3bf778d92d53d2fd3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ProceduralSky" inherits="Sky" category="Core" version="3.2">
	<brief_description>
		Type of [Sky] that is generated procedurally based on user input parameters.
	</brief_description>
	<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. 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.
	</description>
	<tutorials>
	</tutorials>
	<methods>
	</methods>
	<members>
		<member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color( 0.156863, 0.184314, 0.211765, 1 )">
			Color of the ground at the bottom.
		</member>
		<member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve" default="0.02">
			How quickly the [member ground_horizon_color] fades into the [member ground_bottom_color].
		</member>
		<member name="ground_energy" type="float" setter="set_ground_energy" getter="get_ground_energy" default="1.0">
			Amount of energy contribution from the ground.
		</member>
		<member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" default="Color( 0.423529, 0.396078, 0.372549, 1 )">
			Color of the ground at the horizon.
		</member>
		<member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve" default="0.09">
			How quickly the [member sky_horizon_color] fades into the [member sky_top_color].
		</member>
		<member name="sky_energy" type="float" setter="set_sky_energy" getter="get_sky_energy" default="1.0">
			Amount of energy contribution from the sky.
		</member>
		<member name="sky_horizon_color" type="Color" setter="set_sky_horizon_color" getter="get_sky_horizon_color" default="Color( 0.839216, 0.917647, 0.980392, 1 )">
			Color of the sky at the horizon.
		</member>
		<member name="sky_top_color" type="Color" setter="set_sky_top_color" getter="get_sky_top_color" default="Color( 0.647059, 0.839216, 0.945098, 1 )">
			Color of the sky at the top.
		</member>
		<member name="sun_angle_max" type="float" setter="set_sun_angle_max" getter="get_sun_angle_max" default="100.0">
			Distance from center of sun where it fades out completely.
		</member>
		<member name="sun_angle_min" type="float" setter="set_sun_angle_min" getter="get_sun_angle_min" default="1.0">
			Distance from sun where it goes from solid to starting to fade.
		</member>
		<member name="sun_color" type="Color" setter="set_sun_color" getter="get_sun_color" default="Color( 1, 1, 1, 1 )">
			The sun's color.
		</member>
		<member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve" default="0.05">
			How quickly the sun fades away between [member sun_angle_min] and [member sun_angle_max].
		</member>
		<member name="sun_energy" type="float" setter="set_sun_energy" getter="get_sun_energy" default="1.0">
			Amount of energy contribution from the sun.
		</member>
		<member name="sun_latitude" type="float" setter="set_sun_latitude" getter="get_sun_latitude" default="35.0">
			The sun's height using polar coordinates.
		</member>
		<member name="sun_longitude" type="float" setter="set_sun_longitude" getter="get_sun_longitude" default="0.0">
			The direction of the sun using polar coordinates.
		</member>
		<member name="texture_size" type="int" setter="set_texture_size" getter="get_texture_size" enum="ProceduralSky.TextureSize" default="2">
			Size of [Texture] that the ProceduralSky will generate. The size is set using [enum TextureSize].
		</member>
	</members>
	<constants>
		<constant name="TEXTURE_SIZE_256" value="0" enum="TextureSize">
		</constant>
		<constant name="TEXTURE_SIZE_512" value="1" enum="TextureSize">
		</constant>
		<constant name="TEXTURE_SIZE_1024" value="2" enum="TextureSize">
		</constant>
		<constant name="TEXTURE_SIZE_2048" value="3" enum="TextureSize">
		</constant>
		<constant name="TEXTURE_SIZE_4096" value="4" enum="TextureSize">
		</constant>
		<constant name="TEXTURE_SIZE_MAX" value="5" enum="TextureSize">
			Represents the size of the [enum TextureSize] enum.
		</constant>
	</constants>
</class>