class_proceduralsky.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ProceduralSky.xml.
  6. .. _class_ProceduralSky:
  7. ProceduralSky
  8. =============
  9. **Inherits:** :ref:`Sky<class_Sky>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Type of :ref:`Sky<class_Sky>` that is generated procedurally based on user input parameters.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. 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.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  22. | :ref:`Color<class_Color>` | :ref:`ground_bottom_color<class_ProceduralSky_property_ground_bottom_color>` | ``Color( 0.156863, 0.184314, 0.211765, 1 )`` |
  23. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`ground_curve<class_ProceduralSky_property_ground_curve>` | ``0.02`` |
  25. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`ground_energy<class_ProceduralSky_property_ground_energy>` | ``1.0`` |
  27. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  28. | :ref:`Color<class_Color>` | :ref:`ground_horizon_color<class_ProceduralSky_property_ground_horizon_color>` | ``Color( 0.423529, 0.396078, 0.372549, 1 )`` |
  29. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`sky_curve<class_ProceduralSky_property_sky_curve>` | ``0.09`` |
  31. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`sky_energy<class_ProceduralSky_property_sky_energy>` | ``1.0`` |
  33. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  34. | :ref:`Color<class_Color>` | :ref:`sky_horizon_color<class_ProceduralSky_property_sky_horizon_color>` | ``Color( 0.839216, 0.917647, 0.980392, 1 )`` |
  35. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  36. | :ref:`Color<class_Color>` | :ref:`sky_top_color<class_ProceduralSky_property_sky_top_color>` | ``Color( 0.647059, 0.839216, 0.945098, 1 )`` |
  37. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`sun_angle_max<class_ProceduralSky_property_sun_angle_max>` | ``100.0`` |
  39. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`sun_angle_min<class_ProceduralSky_property_sun_angle_min>` | ``1.0`` |
  41. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  42. | :ref:`Color<class_Color>` | :ref:`sun_color<class_ProceduralSky_property_sun_color>` | ``Color( 1, 1, 1, 1 )`` |
  43. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`sun_curve<class_ProceduralSky_property_sun_curve>` | ``0.05`` |
  45. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`sun_energy<class_ProceduralSky_property_sun_energy>` | ``1.0`` |
  47. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  48. | :ref:`float<class_float>` | :ref:`sun_latitude<class_ProceduralSky_property_sun_latitude>` | ``35.0`` |
  49. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  50. | :ref:`float<class_float>` | :ref:`sun_longitude<class_ProceduralSky_property_sun_longitude>` | ``0.0`` |
  51. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  52. | :ref:`TextureSize<enum_ProceduralSky_TextureSize>` | :ref:`texture_size<class_ProceduralSky_property_texture_size>` | ``2`` |
  53. +----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+
  54. .. rst-class:: classref-section-separator
  55. ----
  56. .. rst-class:: classref-descriptions-group
  57. Enumerations
  58. ------------
  59. .. _enum_ProceduralSky_TextureSize:
  60. .. rst-class:: classref-enumeration
  61. enum **TextureSize**:
  62. .. _class_ProceduralSky_constant_TEXTURE_SIZE_256:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_256** = ``0``
  65. Sky texture will be 256x128.
  66. .. _class_ProceduralSky_constant_TEXTURE_SIZE_512:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_512** = ``1``
  69. Sky texture will be 512x256.
  70. .. _class_ProceduralSky_constant_TEXTURE_SIZE_1024:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_1024** = ``2``
  73. Sky texture will be 1024x512. This is the default size.
  74. .. _class_ProceduralSky_constant_TEXTURE_SIZE_2048:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_2048** = ``3``
  77. Sky texture will be 2048x1024.
  78. .. _class_ProceduralSky_constant_TEXTURE_SIZE_4096:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_4096** = ``4``
  81. Sky texture will be 4096x2048.
  82. .. _class_ProceduralSky_constant_TEXTURE_SIZE_MAX:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **TEXTURE_SIZE_MAX** = ``5``
  85. Represents the size of the :ref:`TextureSize<enum_ProceduralSky_TextureSize>` enum.
  86. .. rst-class:: classref-section-separator
  87. ----
  88. .. rst-class:: classref-descriptions-group
  89. Property Descriptions
  90. ---------------------
  91. .. _class_ProceduralSky_property_ground_bottom_color:
  92. .. rst-class:: classref-property
  93. :ref:`Color<class_Color>` **ground_bottom_color** = ``Color( 0.156863, 0.184314, 0.211765, 1 )``
  94. .. rst-class:: classref-property-setget
  95. - void **set_ground_bottom_color** **(** :ref:`Color<class_Color>` value **)**
  96. - :ref:`Color<class_Color>` **get_ground_bottom_color** **(** **)**
  97. Color of the ground at the bottom.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_ProceduralSky_property_ground_curve:
  101. .. rst-class:: classref-property
  102. :ref:`float<class_float>` **ground_curve** = ``0.02``
  103. .. rst-class:: classref-property-setget
  104. - void **set_ground_curve** **(** :ref:`float<class_float>` value **)**
  105. - :ref:`float<class_float>` **get_ground_curve** **(** **)**
  106. How quickly the :ref:`ground_horizon_color<class_ProceduralSky_property_ground_horizon_color>` fades into the :ref:`ground_bottom_color<class_ProceduralSky_property_ground_bottom_color>`.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_ProceduralSky_property_ground_energy:
  110. .. rst-class:: classref-property
  111. :ref:`float<class_float>` **ground_energy** = ``1.0``
  112. .. rst-class:: classref-property-setget
  113. - void **set_ground_energy** **(** :ref:`float<class_float>` value **)**
  114. - :ref:`float<class_float>` **get_ground_energy** **(** **)**
  115. Amount of energy contribution from the ground.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_ProceduralSky_property_ground_horizon_color:
  119. .. rst-class:: classref-property
  120. :ref:`Color<class_Color>` **ground_horizon_color** = ``Color( 0.423529, 0.396078, 0.372549, 1 )``
  121. .. rst-class:: classref-property-setget
  122. - void **set_ground_horizon_color** **(** :ref:`Color<class_Color>` value **)**
  123. - :ref:`Color<class_Color>` **get_ground_horizon_color** **(** **)**
  124. Color of the ground at the horizon.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_ProceduralSky_property_sky_curve:
  128. .. rst-class:: classref-property
  129. :ref:`float<class_float>` **sky_curve** = ``0.09``
  130. .. rst-class:: classref-property-setget
  131. - void **set_sky_curve** **(** :ref:`float<class_float>` value **)**
  132. - :ref:`float<class_float>` **get_sky_curve** **(** **)**
  133. How quickly the :ref:`sky_horizon_color<class_ProceduralSky_property_sky_horizon_color>` fades into the :ref:`sky_top_color<class_ProceduralSky_property_sky_top_color>`.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_ProceduralSky_property_sky_energy:
  137. .. rst-class:: classref-property
  138. :ref:`float<class_float>` **sky_energy** = ``1.0``
  139. .. rst-class:: classref-property-setget
  140. - void **set_sky_energy** **(** :ref:`float<class_float>` value **)**
  141. - :ref:`float<class_float>` **get_sky_energy** **(** **)**
  142. Amount of energy contribution from the sky.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_ProceduralSky_property_sky_horizon_color:
  146. .. rst-class:: classref-property
  147. :ref:`Color<class_Color>` **sky_horizon_color** = ``Color( 0.839216, 0.917647, 0.980392, 1 )``
  148. .. rst-class:: classref-property-setget
  149. - void **set_sky_horizon_color** **(** :ref:`Color<class_Color>` value **)**
  150. - :ref:`Color<class_Color>` **get_sky_horizon_color** **(** **)**
  151. Color of the sky at the horizon.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_ProceduralSky_property_sky_top_color:
  155. .. rst-class:: classref-property
  156. :ref:`Color<class_Color>` **sky_top_color** = ``Color( 0.647059, 0.839216, 0.945098, 1 )``
  157. .. rst-class:: classref-property-setget
  158. - void **set_sky_top_color** **(** :ref:`Color<class_Color>` value **)**
  159. - :ref:`Color<class_Color>` **get_sky_top_color** **(** **)**
  160. Color of the sky at the top.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_ProceduralSky_property_sun_angle_max:
  164. .. rst-class:: classref-property
  165. :ref:`float<class_float>` **sun_angle_max** = ``100.0``
  166. .. rst-class:: classref-property-setget
  167. - void **set_sun_angle_max** **(** :ref:`float<class_float>` value **)**
  168. - :ref:`float<class_float>` **get_sun_angle_max** **(** **)**
  169. Distance from center of sun where it fades out completely.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_ProceduralSky_property_sun_angle_min:
  173. .. rst-class:: classref-property
  174. :ref:`float<class_float>` **sun_angle_min** = ``1.0``
  175. .. rst-class:: classref-property-setget
  176. - void **set_sun_angle_min** **(** :ref:`float<class_float>` value **)**
  177. - :ref:`float<class_float>` **get_sun_angle_min** **(** **)**
  178. Distance from sun where it goes from solid to starting to fade.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_ProceduralSky_property_sun_color:
  182. .. rst-class:: classref-property
  183. :ref:`Color<class_Color>` **sun_color** = ``Color( 1, 1, 1, 1 )``
  184. .. rst-class:: classref-property-setget
  185. - void **set_sun_color** **(** :ref:`Color<class_Color>` value **)**
  186. - :ref:`Color<class_Color>` **get_sun_color** **(** **)**
  187. The sun's color.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_ProceduralSky_property_sun_curve:
  191. .. rst-class:: classref-property
  192. :ref:`float<class_float>` **sun_curve** = ``0.05``
  193. .. rst-class:: classref-property-setget
  194. - void **set_sun_curve** **(** :ref:`float<class_float>` value **)**
  195. - :ref:`float<class_float>` **get_sun_curve** **(** **)**
  196. How quickly the sun fades away between :ref:`sun_angle_min<class_ProceduralSky_property_sun_angle_min>` and :ref:`sun_angle_max<class_ProceduralSky_property_sun_angle_max>`.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_ProceduralSky_property_sun_energy:
  200. .. rst-class:: classref-property
  201. :ref:`float<class_float>` **sun_energy** = ``1.0``
  202. .. rst-class:: classref-property-setget
  203. - void **set_sun_energy** **(** :ref:`float<class_float>` value **)**
  204. - :ref:`float<class_float>` **get_sun_energy** **(** **)**
  205. Amount of energy contribution from the sun.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_ProceduralSky_property_sun_latitude:
  209. .. rst-class:: classref-property
  210. :ref:`float<class_float>` **sun_latitude** = ``35.0``
  211. .. rst-class:: classref-property-setget
  212. - void **set_sun_latitude** **(** :ref:`float<class_float>` value **)**
  213. - :ref:`float<class_float>` **get_sun_latitude** **(** **)**
  214. The sun's height using polar coordinates.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_ProceduralSky_property_sun_longitude:
  218. .. rst-class:: classref-property
  219. :ref:`float<class_float>` **sun_longitude** = ``0.0``
  220. .. rst-class:: classref-property-setget
  221. - void **set_sun_longitude** **(** :ref:`float<class_float>` value **)**
  222. - :ref:`float<class_float>` **get_sun_longitude** **(** **)**
  223. The direction of the sun using polar coordinates.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_ProceduralSky_property_texture_size:
  227. .. rst-class:: classref-property
  228. :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **texture_size** = ``2``
  229. .. rst-class:: classref-property-setget
  230. - void **set_texture_size** **(** :ref:`TextureSize<enum_ProceduralSky_TextureSize>` value **)**
  231. - :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **get_texture_size** **(** **)**
  232. Size of :ref:`Texture<class_Texture>` that the ProceduralSky will generate. The size is set using :ref:`TextureSize<enum_ProceduralSky_TextureSize>`.
  233. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  234. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  235. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  236. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`