class_proceduralsky.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ProceduralSky.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ProceduralSky:
  6. ProceduralSky
  7. =============
  8. **Inherits:** :ref:`Sky<class_Sky>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Type of :ref:`Sky<class_Sky>` that is generated procedurally based on user input parameters.
  13. Properties
  14. ----------
  15. +----------------------------------------------------+--------------------------------------------------------------------------------+
  16. | :ref:`Color<class_Color>` | :ref:`ground_bottom_color<class_ProceduralSky_property_ground_bottom_color>` |
  17. +----------------------------------------------------+--------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`ground_curve<class_ProceduralSky_property_ground_curve>` |
  19. +----------------------------------------------------+--------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`ground_energy<class_ProceduralSky_property_ground_energy>` |
  21. +----------------------------------------------------+--------------------------------------------------------------------------------+
  22. | :ref:`Color<class_Color>` | :ref:`ground_horizon_color<class_ProceduralSky_property_ground_horizon_color>` |
  23. +----------------------------------------------------+--------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`sky_curve<class_ProceduralSky_property_sky_curve>` |
  25. +----------------------------------------------------+--------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`sky_energy<class_ProceduralSky_property_sky_energy>` |
  27. +----------------------------------------------------+--------------------------------------------------------------------------------+
  28. | :ref:`Color<class_Color>` | :ref:`sky_horizon_color<class_ProceduralSky_property_sky_horizon_color>` |
  29. +----------------------------------------------------+--------------------------------------------------------------------------------+
  30. | :ref:`Color<class_Color>` | :ref:`sky_top_color<class_ProceduralSky_property_sky_top_color>` |
  31. +----------------------------------------------------+--------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`sun_angle_max<class_ProceduralSky_property_sun_angle_max>` |
  33. +----------------------------------------------------+--------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`sun_angle_min<class_ProceduralSky_property_sun_angle_min>` |
  35. +----------------------------------------------------+--------------------------------------------------------------------------------+
  36. | :ref:`Color<class_Color>` | :ref:`sun_color<class_ProceduralSky_property_sun_color>` |
  37. +----------------------------------------------------+--------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`sun_curve<class_ProceduralSky_property_sun_curve>` |
  39. +----------------------------------------------------+--------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`sun_energy<class_ProceduralSky_property_sun_energy>` |
  41. +----------------------------------------------------+--------------------------------------------------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`sun_latitude<class_ProceduralSky_property_sun_latitude>` |
  43. +----------------------------------------------------+--------------------------------------------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`sun_longitude<class_ProceduralSky_property_sun_longitude>` |
  45. +----------------------------------------------------+--------------------------------------------------------------------------------+
  46. | :ref:`TextureSize<enum_ProceduralSky_TextureSize>` | :ref:`texture_size<class_ProceduralSky_property_texture_size>` |
  47. +----------------------------------------------------+--------------------------------------------------------------------------------+
  48. Enumerations
  49. ------------
  50. .. _enum_ProceduralSky_TextureSize:
  51. .. _class_ProceduralSky_constant_TEXTURE_SIZE_256:
  52. .. _class_ProceduralSky_constant_TEXTURE_SIZE_512:
  53. .. _class_ProceduralSky_constant_TEXTURE_SIZE_1024:
  54. .. _class_ProceduralSky_constant_TEXTURE_SIZE_2048:
  55. .. _class_ProceduralSky_constant_TEXTURE_SIZE_4096:
  56. .. _class_ProceduralSky_constant_TEXTURE_SIZE_MAX:
  57. enum **TextureSize**:
  58. - **TEXTURE_SIZE_256** = **0**
  59. - **TEXTURE_SIZE_512** = **1**
  60. - **TEXTURE_SIZE_1024** = **2**
  61. - **TEXTURE_SIZE_2048** = **3**
  62. - **TEXTURE_SIZE_4096** = **4**
  63. - **TEXTURE_SIZE_MAX** = **5** --- Represents the size of the :ref:`TextureSize<enum_ProceduralSky_TextureSize>` enum.
  64. Description
  65. -----------
  66. 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.
  67. 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 because it is updated on a background thread when multi-threading is available.
  68. Property Descriptions
  69. ---------------------
  70. .. _class_ProceduralSky_property_ground_bottom_color:
  71. - :ref:`Color<class_Color>` **ground_bottom_color**
  72. +----------+--------------------------------+
  73. | *Setter* | set_ground_bottom_color(value) |
  74. +----------+--------------------------------+
  75. | *Getter* | get_ground_bottom_color() |
  76. +----------+--------------------------------+
  77. Color of the ground at the bottom.
  78. ----
  79. .. _class_ProceduralSky_property_ground_curve:
  80. - :ref:`float<class_float>` **ground_curve**
  81. +----------+-------------------------+
  82. | *Setter* | set_ground_curve(value) |
  83. +----------+-------------------------+
  84. | *Getter* | get_ground_curve() |
  85. +----------+-------------------------+
  86. 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>`.
  87. ----
  88. .. _class_ProceduralSky_property_ground_energy:
  89. - :ref:`float<class_float>` **ground_energy**
  90. +----------+--------------------------+
  91. | *Setter* | set_ground_energy(value) |
  92. +----------+--------------------------+
  93. | *Getter* | get_ground_energy() |
  94. +----------+--------------------------+
  95. Amount of energy contribution from the ground.
  96. ----
  97. .. _class_ProceduralSky_property_ground_horizon_color:
  98. - :ref:`Color<class_Color>` **ground_horizon_color**
  99. +----------+---------------------------------+
  100. | *Setter* | set_ground_horizon_color(value) |
  101. +----------+---------------------------------+
  102. | *Getter* | get_ground_horizon_color() |
  103. +----------+---------------------------------+
  104. Color of the ground at the horizon.
  105. ----
  106. .. _class_ProceduralSky_property_sky_curve:
  107. - :ref:`float<class_float>` **sky_curve**
  108. +----------+----------------------+
  109. | *Setter* | set_sky_curve(value) |
  110. +----------+----------------------+
  111. | *Getter* | get_sky_curve() |
  112. +----------+----------------------+
  113. 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>`.
  114. ----
  115. .. _class_ProceduralSky_property_sky_energy:
  116. - :ref:`float<class_float>` **sky_energy**
  117. +----------+-----------------------+
  118. | *Setter* | set_sky_energy(value) |
  119. +----------+-----------------------+
  120. | *Getter* | get_sky_energy() |
  121. +----------+-----------------------+
  122. Amount of energy contribution from the sky.
  123. ----
  124. .. _class_ProceduralSky_property_sky_horizon_color:
  125. - :ref:`Color<class_Color>` **sky_horizon_color**
  126. +----------+------------------------------+
  127. | *Setter* | set_sky_horizon_color(value) |
  128. +----------+------------------------------+
  129. | *Getter* | get_sky_horizon_color() |
  130. +----------+------------------------------+
  131. Color of the sky at the horizon.
  132. ----
  133. .. _class_ProceduralSky_property_sky_top_color:
  134. - :ref:`Color<class_Color>` **sky_top_color**
  135. +----------+--------------------------+
  136. | *Setter* | set_sky_top_color(value) |
  137. +----------+--------------------------+
  138. | *Getter* | get_sky_top_color() |
  139. +----------+--------------------------+
  140. Color of the sky at the top.
  141. ----
  142. .. _class_ProceduralSky_property_sun_angle_max:
  143. - :ref:`float<class_float>` **sun_angle_max**
  144. +----------+--------------------------+
  145. | *Setter* | set_sun_angle_max(value) |
  146. +----------+--------------------------+
  147. | *Getter* | get_sun_angle_max() |
  148. +----------+--------------------------+
  149. Distance from center of sun where it fades out completely.
  150. ----
  151. .. _class_ProceduralSky_property_sun_angle_min:
  152. - :ref:`float<class_float>` **sun_angle_min**
  153. +----------+--------------------------+
  154. | *Setter* | set_sun_angle_min(value) |
  155. +----------+--------------------------+
  156. | *Getter* | get_sun_angle_min() |
  157. +----------+--------------------------+
  158. Distance from sun where it goes from solid to starting to fade.
  159. ----
  160. .. _class_ProceduralSky_property_sun_color:
  161. - :ref:`Color<class_Color>` **sun_color**
  162. +----------+----------------------+
  163. | *Setter* | set_sun_color(value) |
  164. +----------+----------------------+
  165. | *Getter* | get_sun_color() |
  166. +----------+----------------------+
  167. Color of the sun.
  168. ----
  169. .. _class_ProceduralSky_property_sun_curve:
  170. - :ref:`float<class_float>` **sun_curve**
  171. +----------+----------------------+
  172. | *Setter* | set_sun_curve(value) |
  173. +----------+----------------------+
  174. | *Getter* | get_sun_curve() |
  175. +----------+----------------------+
  176. 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>`.
  177. ----
  178. .. _class_ProceduralSky_property_sun_energy:
  179. - :ref:`float<class_float>` **sun_energy**
  180. +----------+-----------------------+
  181. | *Setter* | set_sun_energy(value) |
  182. +----------+-----------------------+
  183. | *Getter* | get_sun_energy() |
  184. +----------+-----------------------+
  185. Amount of energy contribution from the sun.
  186. ----
  187. .. _class_ProceduralSky_property_sun_latitude:
  188. - :ref:`float<class_float>` **sun_latitude**
  189. +----------+-------------------------+
  190. | *Setter* | set_sun_latitude(value) |
  191. +----------+-------------------------+
  192. | *Getter* | get_sun_latitude() |
  193. +----------+-------------------------+
  194. The suns height using polar coordinates.
  195. ----
  196. .. _class_ProceduralSky_property_sun_longitude:
  197. - :ref:`float<class_float>` **sun_longitude**
  198. +----------+--------------------------+
  199. | *Setter* | set_sun_longitude(value) |
  200. +----------+--------------------------+
  201. | *Getter* | get_sun_longitude() |
  202. +----------+--------------------------+
  203. The direction of the sun using polar coordinates.
  204. ----
  205. .. _class_ProceduralSky_property_texture_size:
  206. - :ref:`TextureSize<enum_ProceduralSky_TextureSize>` **texture_size**
  207. +----------+-------------------------+
  208. | *Setter* | set_texture_size(value) |
  209. +----------+-------------------------+
  210. | *Getter* | get_texture_size() |
  211. +----------+-------------------------+
  212. Size of :ref:`Texture<class_Texture>` that the ProceduralSky will generate. The size is set using :ref:`TextureSize<enum_ProceduralSky_TextureSize>`.