class_proceduralskymaterial.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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/4.1/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/ProceduralSkyMaterial.xml.
  6. .. _class_ProceduralSkyMaterial:
  7. ProceduralSkyMaterial
  8. =====================
  9. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A :ref:`Material<class_Material>` used with :ref:`Sky<class_Sky>` to generate a background based on user input parameters.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. ProceduralSkyMaterial 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 **ProceduralSkyMaterial** uses a lightweight shader to draw the sky and is thus suited for real time updates. When you do not need a quick sky that is not realistic, this is a good option. If you need a more realistic option, try using :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>` instead.
  16. The **ProceduralSkyMaterial** supports up to 4 suns. Each sun takes its color, energy, and direction from the corresponding :ref:`DirectionalLight3D<class_DirectionalLight3D>` in the scene.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  23. | :ref:`Color<class_Color>` | :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>` | ``Color(0.2, 0.169, 0.133, 1)`` |
  24. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`ground_curve<class_ProceduralSkyMaterial_property_ground_curve>` | ``0.02`` |
  26. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`ground_energy_multiplier<class_ProceduralSkyMaterial_property_ground_energy_multiplier>` | ``1.0`` |
  28. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  29. | :ref:`Color<class_Color>` | :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>` | ``Color(0.6463, 0.6558, 0.6708, 1)`` |
  30. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  31. | :ref:`Texture2D<class_Texture2D>` | :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>` | |
  32. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  33. | :ref:`Color<class_Color>` | :ref:`sky_cover_modulate<class_ProceduralSkyMaterial_property_sky_cover_modulate>` | ``Color(1, 1, 1, 1)`` |
  34. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`sky_curve<class_ProceduralSkyMaterial_property_sky_curve>` | ``0.15`` |
  36. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`sky_energy_multiplier<class_ProceduralSkyMaterial_property_sky_energy_multiplier>` | ``1.0`` |
  38. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  39. | :ref:`Color<class_Color>` | :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>` | ``Color(0.6463, 0.6558, 0.6708, 1)`` |
  40. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  41. | :ref:`Color<class_Color>` | :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>` | ``Color(0.385, 0.454, 0.55, 1)`` |
  42. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  43. | :ref:`float<class_float>` | :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>` | ``30.0`` |
  44. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`sun_curve<class_ProceduralSkyMaterial_property_sun_curve>` | ``0.15`` |
  46. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_ProceduralSkyMaterial_property_use_debanding>` | ``true`` |
  48. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Property Descriptions
  53. ---------------------
  54. .. _class_ProceduralSkyMaterial_property_ground_bottom_color:
  55. .. rst-class:: classref-property
  56. :ref:`Color<class_Color>` **ground_bottom_color** = ``Color(0.2, 0.169, 0.133, 1)``
  57. .. rst-class:: classref-property-setget
  58. - void **set_ground_bottom_color** **(** :ref:`Color<class_Color>` value **)**
  59. - :ref:`Color<class_Color>` **get_ground_bottom_color** **(** **)**
  60. Color of the ground at the bottom. Blends with :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>`.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_ProceduralSkyMaterial_property_ground_curve:
  64. .. rst-class:: classref-property
  65. :ref:`float<class_float>` **ground_curve** = ``0.02``
  66. .. rst-class:: classref-property-setget
  67. - void **set_ground_curve** **(** :ref:`float<class_float>` value **)**
  68. - :ref:`float<class_float>` **get_ground_curve** **(** **)**
  69. How quickly the :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>` fades into the :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>`.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_ProceduralSkyMaterial_property_ground_energy_multiplier:
  73. .. rst-class:: classref-property
  74. :ref:`float<class_float>` **ground_energy_multiplier** = ``1.0``
  75. .. rst-class:: classref-property-setget
  76. - void **set_ground_energy_multiplier** **(** :ref:`float<class_float>` value **)**
  77. - :ref:`float<class_float>` **get_ground_energy_multiplier** **(** **)**
  78. Multiplier for ground color. A higher value will make the ground brighter.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_ProceduralSkyMaterial_property_ground_horizon_color:
  82. .. rst-class:: classref-property
  83. :ref:`Color<class_Color>` **ground_horizon_color** = ``Color(0.6463, 0.6558, 0.6708, 1)``
  84. .. rst-class:: classref-property-setget
  85. - void **set_ground_horizon_color** **(** :ref:`Color<class_Color>` value **)**
  86. - :ref:`Color<class_Color>` **get_ground_horizon_color** **(** **)**
  87. Color of the ground at the horizon. Blends with :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>`.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_ProceduralSkyMaterial_property_sky_cover:
  91. .. rst-class:: classref-property
  92. :ref:`Texture2D<class_Texture2D>` **sky_cover**
  93. .. rst-class:: classref-property-setget
  94. - void **set_sky_cover** **(** :ref:`Texture2D<class_Texture2D>` value **)**
  95. - :ref:`Texture2D<class_Texture2D>` **get_sky_cover** **(** **)**
  96. The sky cover texture to use. This texture must use an equirectangular projection (similar to :ref:`PanoramaSkyMaterial<class_PanoramaSkyMaterial>`). The texture's colors will be *added* to the existing sky color, and will be multiplied by :ref:`sky_energy_multiplier<class_ProceduralSkyMaterial_property_sky_energy_multiplier>` and :ref:`sky_cover_modulate<class_ProceduralSkyMaterial_property_sky_cover_modulate>`. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look).
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_ProceduralSkyMaterial_property_sky_cover_modulate:
  100. .. rst-class:: classref-property
  101. :ref:`Color<class_Color>` **sky_cover_modulate** = ``Color(1, 1, 1, 1)``
  102. .. rst-class:: classref-property-setget
  103. - void **set_sky_cover_modulate** **(** :ref:`Color<class_Color>` value **)**
  104. - :ref:`Color<class_Color>` **get_sky_cover_modulate** **(** **)**
  105. The tint to apply to the :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>` texture. This can be used to change the sky cover's colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined in :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>`.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_ProceduralSkyMaterial_property_sky_curve:
  109. .. rst-class:: classref-property
  110. :ref:`float<class_float>` **sky_curve** = ``0.15``
  111. .. rst-class:: classref-property-setget
  112. - void **set_sky_curve** **(** :ref:`float<class_float>` value **)**
  113. - :ref:`float<class_float>` **get_sky_curve** **(** **)**
  114. How quickly the :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>` fades into the :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>`.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_ProceduralSkyMaterial_property_sky_energy_multiplier:
  118. .. rst-class:: classref-property
  119. :ref:`float<class_float>` **sky_energy_multiplier** = ``1.0``
  120. .. rst-class:: classref-property-setget
  121. - void **set_sky_energy_multiplier** **(** :ref:`float<class_float>` value **)**
  122. - :ref:`float<class_float>` **get_sky_energy_multiplier** **(** **)**
  123. Multiplier for sky color. A higher value will make the sky brighter.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_ProceduralSkyMaterial_property_sky_horizon_color:
  127. .. rst-class:: classref-property
  128. :ref:`Color<class_Color>` **sky_horizon_color** = ``Color(0.6463, 0.6558, 0.6708, 1)``
  129. .. rst-class:: classref-property-setget
  130. - void **set_sky_horizon_color** **(** :ref:`Color<class_Color>` value **)**
  131. - :ref:`Color<class_Color>` **get_sky_horizon_color** **(** **)**
  132. Color of the sky at the horizon. Blends with :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>`.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_ProceduralSkyMaterial_property_sky_top_color:
  136. .. rst-class:: classref-property
  137. :ref:`Color<class_Color>` **sky_top_color** = ``Color(0.385, 0.454, 0.55, 1)``
  138. .. rst-class:: classref-property-setget
  139. - void **set_sky_top_color** **(** :ref:`Color<class_Color>` value **)**
  140. - :ref:`Color<class_Color>` **get_sky_top_color** **(** **)**
  141. Color of the sky at the top. Blends with :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>`.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_ProceduralSkyMaterial_property_sun_angle_max:
  145. .. rst-class:: classref-property
  146. :ref:`float<class_float>` **sun_angle_max** = ``30.0``
  147. .. rst-class:: classref-property-setget
  148. - void **set_sun_angle_max** **(** :ref:`float<class_float>` value **)**
  149. - :ref:`float<class_float>` **get_sun_angle_max** **(** **)**
  150. Distance from center of sun where it fades out completely.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_ProceduralSkyMaterial_property_sun_curve:
  154. .. rst-class:: classref-property
  155. :ref:`float<class_float>` **sun_curve** = ``0.15``
  156. .. rst-class:: classref-property-setget
  157. - void **set_sun_curve** **(** :ref:`float<class_float>` value **)**
  158. - :ref:`float<class_float>` **get_sun_curve** **(** **)**
  159. How quickly the sun fades away between the edge of the sun disk and :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>`.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_ProceduralSkyMaterial_property_use_debanding:
  163. .. rst-class:: classref-property
  164. :ref:`bool<class_bool>` **use_debanding** = ``true``
  165. .. rst-class:: classref-property-setget
  166. - void **set_use_debanding** **(** :ref:`bool<class_bool>` value **)**
  167. - :ref:`bool<class_bool>` **get_use_debanding** **(** **)**
  168. If ``true``, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky.
  169. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  170. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  171. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  172. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  173. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  174. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  175. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`