You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Singleton to facilitate the baking and updating of noise textures.
5
+
</brief_description>
6
+
<description>
7
+
Baking and updating noise textures is a performance costly operation best done behind a loading screen or using background threads.
8
+
Each bake function is available as a single-threaded version and as an async task version that uses the [WorkerThreadPool].
9
+
10
+
The single-threaded version will be executed instant but block the main thread until the baking of the noise image(s) is finished.
11
+
The async version will use a background thread to do the baking and may take multiple frames until finished and synchronized back with the main thread.
12
+
Noise textures that finished their bake using async threads are synced on the [signal RenderingServer.frame_pre_draw] signal.
13
+
14
+
On platforms that do not support threads (e.g. web) the async functions automatically do a fallback to the single-threaded function equivalent.
15
+
Be aware of such fallback as spawning or updating noise textures at runtime without thread support can easily impact a projects frame rate.
16
+
17
+
Noise textures that are already baking can not be queued again for another bake until the current bake is finished.
18
+
Use [method is_noise_texture_2d_baking] and [method is_noise_texture_3d_baking] to check the bake state of a noise texture before queuing them.
19
+
Be aware that most noise textures queue themself automatically for an update when changing their properties but do so deferred with a delay.
20
+
21
+
Avoid connecting signals and callbacks to functions that immediately rebake a noise texture on a callback from the generator, or one of the emitted resource changed signals.
22
+
Such signal spaghetti can cause a deadlock due to often creating an endless loop of baking and signal emit.
Bakes the provided [param noise_texture] with the provided [param bake_function] as an async task running on a background thread. After the process is finished the optional [param callback] will be called.
Bakes the provided [param noise_texture] with the provided [param bake_function] as an async task running on a background thread. After the process is finished the optional [param callback] will be called.
0 commit comments