class_proceduralskymaterial.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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 material that defines a simple sky for a :ref:`Sky<class_Sky>` resource.
  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 defined by a main color, a color at the horizon, and an easing curve to interpolate between them. Suns are described by a position in the sky, a color, and a max angle from the sun at which the easing curve ends. The max angle therefore defines the size of the sun in the sky.
  15. \ **ProceduralSkyMaterial** supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four :ref:`DirectionalLight3D<class_DirectionalLight3D>` nodes in the scene. This means that the suns are defined individually by the properties of their corresponding :ref:`DirectionalLight3D<class_DirectionalLight3D>`\ s and globally by :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>` and :ref:`sun_curve<class_ProceduralSkyMaterial_property_sun_curve>`.
  16. \ **ProceduralSkyMaterial** uses a lightweight shader to draw the sky and is therefore suited for real-time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>`.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`energy_multiplier<class_ProceduralSkyMaterial_property_energy_multiplier>` | ``1.0`` |
  24. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  25. | :ref:`Color<class_Color>` | :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>` | ``Color(0.2, 0.169, 0.133, 1)`` |
  26. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`ground_curve<class_ProceduralSkyMaterial_property_ground_curve>` | ``0.02`` |
  28. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`ground_energy_multiplier<class_ProceduralSkyMaterial_property_ground_energy_multiplier>` | ``1.0`` |
  30. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  31. | :ref:`Color<class_Color>` | :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>` | ``Color(0.6463, 0.6558, 0.6708, 1)`` |
  32. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  33. | :ref:`Texture2D<class_Texture2D>` | :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>` | |
  34. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  35. | :ref:`Color<class_Color>` | :ref:`sky_cover_modulate<class_ProceduralSkyMaterial_property_sky_cover_modulate>` | ``Color(1, 1, 1, 1)`` |
  36. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`sky_curve<class_ProceduralSkyMaterial_property_sky_curve>` | ``0.15`` |
  38. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`sky_energy_multiplier<class_ProceduralSkyMaterial_property_sky_energy_multiplier>` | ``1.0`` |
  40. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  41. | :ref:`Color<class_Color>` | :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>` | ``Color(0.6463, 0.6558, 0.6708, 1)`` |
  42. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  43. | :ref:`Color<class_Color>` | :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>` | ``Color(0.385, 0.454, 0.55, 1)`` |
  44. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>` | ``30.0`` |
  46. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  47. | :ref:`float<class_float>` | :ref:`sun_curve<class_ProceduralSkyMaterial_property_sun_curve>` | ``0.15`` |
  48. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_ProceduralSkyMaterial_property_use_debanding>` | ``true`` |
  50. +-----------------------------------+------------------------------------------------------------------------------------------------+--------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_ProceduralSkyMaterial_property_energy_multiplier:
  57. .. rst-class:: classref-property
  58. :ref:`float<class_float>` **energy_multiplier** = ``1.0`` :ref:`🔗<class_ProceduralSkyMaterial_property_energy_multiplier>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_energy_multiplier**\ (\ value\: :ref:`float<class_float>`\ )
  61. - :ref:`float<class_float>` **get_energy_multiplier**\ (\ )
  62. The sky's overall brightness multiplier. Higher values result in a brighter sky.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_ProceduralSkyMaterial_property_ground_bottom_color:
  66. .. rst-class:: classref-property
  67. :ref:`Color<class_Color>` **ground_bottom_color** = ``Color(0.2, 0.169, 0.133, 1)`` :ref:`🔗<class_ProceduralSkyMaterial_property_ground_bottom_color>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_ground_bottom_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  70. - :ref:`Color<class_Color>` **get_ground_bottom_color**\ (\ )
  71. Color of the ground at the bottom. Blends with :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>`.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_ProceduralSkyMaterial_property_ground_curve:
  75. .. rst-class:: classref-property
  76. :ref:`float<class_float>` **ground_curve** = ``0.02`` :ref:`🔗<class_ProceduralSkyMaterial_property_ground_curve>`
  77. .. rst-class:: classref-property-setget
  78. - |void| **set_ground_curve**\ (\ value\: :ref:`float<class_float>`\ )
  79. - :ref:`float<class_float>` **get_ground_curve**\ (\ )
  80. 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>`.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_ProceduralSkyMaterial_property_ground_energy_multiplier:
  84. .. rst-class:: classref-property
  85. :ref:`float<class_float>` **ground_energy_multiplier** = ``1.0`` :ref:`🔗<class_ProceduralSkyMaterial_property_ground_energy_multiplier>`
  86. .. rst-class:: classref-property-setget
  87. - |void| **set_ground_energy_multiplier**\ (\ value\: :ref:`float<class_float>`\ )
  88. - :ref:`float<class_float>` **get_ground_energy_multiplier**\ (\ )
  89. Multiplier for ground color. A higher value will make the ground brighter.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_ProceduralSkyMaterial_property_ground_horizon_color:
  93. .. rst-class:: classref-property
  94. :ref:`Color<class_Color>` **ground_horizon_color** = ``Color(0.6463, 0.6558, 0.6708, 1)`` :ref:`🔗<class_ProceduralSkyMaterial_property_ground_horizon_color>`
  95. .. rst-class:: classref-property-setget
  96. - |void| **set_ground_horizon_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  97. - :ref:`Color<class_Color>` **get_ground_horizon_color**\ (\ )
  98. Color of the ground at the horizon. Blends with :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>`.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_ProceduralSkyMaterial_property_sky_cover:
  102. .. rst-class:: classref-property
  103. :ref:`Texture2D<class_Texture2D>` **sky_cover** :ref:`🔗<class_ProceduralSkyMaterial_property_sky_cover>`
  104. .. rst-class:: classref-property-setget
  105. - |void| **set_sky_cover**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  106. - :ref:`Texture2D<class_Texture2D>` **get_sky_cover**\ (\ )
  107. 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).
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_ProceduralSkyMaterial_property_sky_cover_modulate:
  111. .. rst-class:: classref-property
  112. :ref:`Color<class_Color>` **sky_cover_modulate** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_ProceduralSkyMaterial_property_sky_cover_modulate>`
  113. .. rst-class:: classref-property-setget
  114. - |void| **set_sky_cover_modulate**\ (\ value\: :ref:`Color<class_Color>`\ )
  115. - :ref:`Color<class_Color>` **get_sky_cover_modulate**\ (\ )
  116. 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>`.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_ProceduralSkyMaterial_property_sky_curve:
  120. .. rst-class:: classref-property
  121. :ref:`float<class_float>` **sky_curve** = ``0.15`` :ref:`🔗<class_ProceduralSkyMaterial_property_sky_curve>`
  122. .. rst-class:: classref-property-setget
  123. - |void| **set_sky_curve**\ (\ value\: :ref:`float<class_float>`\ )
  124. - :ref:`float<class_float>` **get_sky_curve**\ (\ )
  125. 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>`.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_ProceduralSkyMaterial_property_sky_energy_multiplier:
  129. .. rst-class:: classref-property
  130. :ref:`float<class_float>` **sky_energy_multiplier** = ``1.0`` :ref:`🔗<class_ProceduralSkyMaterial_property_sky_energy_multiplier>`
  131. .. rst-class:: classref-property-setget
  132. - |void| **set_sky_energy_multiplier**\ (\ value\: :ref:`float<class_float>`\ )
  133. - :ref:`float<class_float>` **get_sky_energy_multiplier**\ (\ )
  134. Multiplier for sky color. A higher value will make the sky brighter.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_ProceduralSkyMaterial_property_sky_horizon_color:
  138. .. rst-class:: classref-property
  139. :ref:`Color<class_Color>` **sky_horizon_color** = ``Color(0.6463, 0.6558, 0.6708, 1)`` :ref:`🔗<class_ProceduralSkyMaterial_property_sky_horizon_color>`
  140. .. rst-class:: classref-property-setget
  141. - |void| **set_sky_horizon_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  142. - :ref:`Color<class_Color>` **get_sky_horizon_color**\ (\ )
  143. Color of the sky at the horizon. Blends with :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>`.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_ProceduralSkyMaterial_property_sky_top_color:
  147. .. rst-class:: classref-property
  148. :ref:`Color<class_Color>` **sky_top_color** = ``Color(0.385, 0.454, 0.55, 1)`` :ref:`🔗<class_ProceduralSkyMaterial_property_sky_top_color>`
  149. .. rst-class:: classref-property-setget
  150. - |void| **set_sky_top_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  151. - :ref:`Color<class_Color>` **get_sky_top_color**\ (\ )
  152. Color of the sky at the top. Blends with :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>`.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_ProceduralSkyMaterial_property_sun_angle_max:
  156. .. rst-class:: classref-property
  157. :ref:`float<class_float>` **sun_angle_max** = ``30.0`` :ref:`🔗<class_ProceduralSkyMaterial_property_sun_angle_max>`
  158. .. rst-class:: classref-property-setget
  159. - |void| **set_sun_angle_max**\ (\ value\: :ref:`float<class_float>`\ )
  160. - :ref:`float<class_float>` **get_sun_angle_max**\ (\ )
  161. Distance from center of sun where it fades out completely.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_ProceduralSkyMaterial_property_sun_curve:
  165. .. rst-class:: classref-property
  166. :ref:`float<class_float>` **sun_curve** = ``0.15`` :ref:`🔗<class_ProceduralSkyMaterial_property_sun_curve>`
  167. .. rst-class:: classref-property-setget
  168. - |void| **set_sun_curve**\ (\ value\: :ref:`float<class_float>`\ )
  169. - :ref:`float<class_float>` **get_sun_curve**\ (\ )
  170. How quickly the sun fades away between the edge of the sun disk and :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>`.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_ProceduralSkyMaterial_property_use_debanding:
  174. .. rst-class:: classref-property
  175. :ref:`bool<class_bool>` **use_debanding** = ``true`` :ref:`🔗<class_ProceduralSkyMaterial_property_use_debanding>`
  176. .. rst-class:: classref-property-setget
  177. - |void| **set_use_debanding**\ (\ value\: :ref:`bool<class_bool>`\ )
  178. - :ref:`bool<class_bool>` **get_use_debanding**\ (\ )
  179. 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.
  180. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  181. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  182. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  183. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  184. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  185. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  186. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  187. .. |void| replace:: :abbr:`void (No return value.)`