summaryrefslogtreecommitdiff
path: root/doc/classes/ProceduralSky.xml
blob: 664c80be5e73d654730f4f7de8a78fa4fa109c67 (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
80
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ProceduralSky" inherits="Sky" category="Core" version="3.1">
	<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 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 becuase it is updated on a background thread when multi-threading is available.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
	</methods>
	<members>
		<member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color">
			Color of the ground at the bottom.
		</member>
		<member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve">
			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">
			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">
			Color of the ground at the horizon.
		</member>
		<member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve">
			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">
			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">
			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">
			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">
			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">
			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">
			Color of the sun.
		</member>
		<member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve">
			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">
			Amount of energy contribution from the sun.
		</member>
		<member name="sun_latitude" type="float" setter="set_sun_latitude" getter="get_sun_latitude">
			The suns height using polar coordinates. 
		</member>
		<member name="sun_longitude" type="float" setter="set_sun_longitude" getter="get_sun_longitude">
			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">
			Size of [Texture] that the ProceduralSky will generate.
		</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">
		</constant>
	</constants>
</class>