/
ProceduralSky.hx
211 lines (160 loc) · 5.91 KB
/
ProceduralSky.hx
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
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.
**/
@:libType
@:csNative
@:native("Godot.ProceduralSky")
@:autoBuild(godot.Godot.buildUserClass())
extern class ProceduralSky extends godot.Sky {
/**
Size of `godot.Texture` that the ProceduralSky will generate. The size is set using `godot.ProceduralSky_TextureSizeEnum`.
**/
@:native("TextureSize")
public var textureSize:godot.ProceduralSky_TextureSizeEnum;
/**
Amount of energy contribution from the sun.
**/
@:native("SunEnergy")
public var sunEnergy:Single;
/**
How quickly the sun fades away between `godot.ProceduralSky.sunAngleMin` and `godot.ProceduralSky.sunAngleMax`.
**/
@:native("SunCurve")
public var sunCurve:Single;
/**
Distance from center of sun where it fades out completely.
**/
@:native("SunAngleMax")
public var sunAngleMax:Single;
/**
Distance from sun where it goes from solid to starting to fade.
**/
@:native("SunAngleMin")
public var sunAngleMin:Single;
/**
The direction of the sun using polar coordinates.
**/
@:native("SunLongitude")
public var sunLongitude:Single;
/**
The sun's height using polar coordinates.
**/
@:native("SunLatitude")
public var sunLatitude:Single;
/**
The sun's color.
**/
@:native("SunColor")
public var sunColor:godot.Color;
/**
Amount of energy contribution from the ground.
**/
@:native("GroundEnergy")
public var groundEnergy:Single;
/**
How quickly the `godot.ProceduralSky.groundHorizonColor` fades into the `godot.ProceduralSky.groundBottomColor`.
**/
@:native("GroundCurve")
public var groundCurve:Single;
/**
Color of the ground at the horizon.
**/
@:native("GroundHorizonColor")
public var groundHorizonColor:godot.Color;
/**
Color of the ground at the bottom.
**/
@:native("GroundBottomColor")
public var groundBottomColor:godot.Color;
/**
Amount of energy contribution from the sky.
**/
@:native("SkyEnergy")
public var skyEnergy:Single;
/**
How quickly the `godot.ProceduralSky.skyHorizonColor` fades into the `godot.ProceduralSky.skyTopColor`.
**/
@:native("SkyCurve")
public var skyCurve:Single;
/**
Color of the sky at the horizon.
**/
@:native("SkyHorizonColor")
public var skyHorizonColor:godot.Color;
/**
Color of the sky at the top.
**/
@:native("SkyTopColor")
public var skyTopColor:godot.Color;
@:native("new")
public function new():Void;
@:native("SetSkyTopColor")
public function setSkyTopColor(color:godot.Color):Void;
@:native("GetSkyTopColor")
public function getSkyTopColor():godot.Color;
@:native("SetSkyHorizonColor")
public function setSkyHorizonColor(color:godot.Color):Void;
@:native("GetSkyHorizonColor")
public function getSkyHorizonColor():godot.Color;
@:native("SetSkyCurve")
public function setSkyCurve(curve:Single):Void;
@:native("GetSkyCurve")
public function getSkyCurve():Single;
@:native("SetSkyEnergy")
public function setSkyEnergy(energy:Single):Void;
@:native("GetSkyEnergy")
public function getSkyEnergy():Single;
@:native("SetGroundBottomColor")
public function setGroundBottomColor(color:godot.Color):Void;
@:native("GetGroundBottomColor")
public function getGroundBottomColor():godot.Color;
@:native("SetGroundHorizonColor")
public function setGroundHorizonColor(color:godot.Color):Void;
@:native("GetGroundHorizonColor")
public function getGroundHorizonColor():godot.Color;
@:native("SetGroundCurve")
public function setGroundCurve(curve:Single):Void;
@:native("GetGroundCurve")
public function getGroundCurve():Single;
@:native("SetGroundEnergy")
public function setGroundEnergy(energy:Single):Void;
@:native("GetGroundEnergy")
public function getGroundEnergy():Single;
@:native("SetSunColor")
public function setSunColor(color:godot.Color):Void;
@:native("GetSunColor")
public function getSunColor():godot.Color;
@:native("SetSunLatitude")
public function setSunLatitude(degrees:Single):Void;
@:native("GetSunLatitude")
public function getSunLatitude():Single;
@:native("SetSunLongitude")
public function setSunLongitude(degrees:Single):Void;
@:native("GetSunLongitude")
public function getSunLongitude():Single;
@:native("SetSunAngleMin")
public function setSunAngleMin(degrees:Single):Void;
@:native("GetSunAngleMin")
public function getSunAngleMin():Single;
@:native("SetSunAngleMax")
public function setSunAngleMax(degrees:Single):Void;
@:native("GetSunAngleMax")
public function getSunAngleMax():Single;
@:native("SetSunCurve")
public function setSunCurve(curve:Single):Void;
@:native("GetSunCurve")
public function getSunCurve():Single;
@:native("SetSunEnergy")
public function setSunEnergy(energy:Single):Void;
@:native("GetSunEnergy")
public function getSunEnergy():Single;
@:native("SetTextureSize")
public function setTextureSize(size:godot.ProceduralSky_TextureSizeEnum):Void;
@:native("GetTextureSize")
public function getTextureSize():godot.ProceduralSky_TextureSizeEnum;
}