class_physicalskymaterial.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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/PhysicalSkyMaterial.xml.
  6. .. _class_PhysicalSkyMaterial:
  7. PhysicalSkyMaterial
  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 sky for a :ref:`Sky<class_Sky>` resource by a set of physical properties.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **PhysicalSkyMaterial** uses the Preetham analytic daylight model to draw a sky based on physical properties. This results in a substantially more realistic sky than the :ref:`ProceduralSkyMaterial<class_ProceduralSkyMaterial>`, but it is slightly slower and less flexible.
  15. The **PhysicalSkyMaterial** only supports one sun. The color, energy, and direction of the sun are taken from the first :ref:`DirectionalLight3D<class_DirectionalLight3D>` in the scene tree.
  16. As it is based on a daylight model, the sky fades to black as the sunset ends. If you want a full day/night cycle, you will have to add a night sky by converting this to a :ref:`ShaderMaterial<class_ShaderMaterial>` and adding a night sky directly into the resulting shader.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  23. | :ref:`float<class_float>` | :ref:`energy_multiplier<class_PhysicalSkyMaterial_property_energy_multiplier>` | ``1.0`` |
  24. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  25. | :ref:`Color<class_Color>` | :ref:`ground_color<class_PhysicalSkyMaterial_property_ground_color>` | ``Color(0.1, 0.07, 0.034, 1)`` |
  26. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  27. | :ref:`float<class_float>` | :ref:`mie_coefficient<class_PhysicalSkyMaterial_property_mie_coefficient>` | ``0.005`` |
  28. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  29. | :ref:`Color<class_Color>` | :ref:`mie_color<class_PhysicalSkyMaterial_property_mie_color>` | ``Color(0.69, 0.729, 0.812, 1)`` |
  30. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  31. | :ref:`float<class_float>` | :ref:`mie_eccentricity<class_PhysicalSkyMaterial_property_mie_eccentricity>` | ``0.8`` |
  32. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  33. | :ref:`Texture2D<class_Texture2D>` | :ref:`night_sky<class_PhysicalSkyMaterial_property_night_sky>` | |
  34. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  35. | :ref:`float<class_float>` | :ref:`rayleigh_coefficient<class_PhysicalSkyMaterial_property_rayleigh_coefficient>` | ``2.0`` |
  36. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  37. | :ref:`Color<class_Color>` | :ref:`rayleigh_color<class_PhysicalSkyMaterial_property_rayleigh_color>` | ``Color(0.3, 0.405, 0.6, 1)`` |
  38. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  39. | :ref:`float<class_float>` | :ref:`sun_disk_scale<class_PhysicalSkyMaterial_property_sun_disk_scale>` | ``1.0`` |
  40. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  41. | :ref:`float<class_float>` | :ref:`turbidity<class_PhysicalSkyMaterial_property_turbidity>` | ``10.0`` |
  42. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_PhysicalSkyMaterial_property_use_debanding>` | ``true`` |
  44. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_PhysicalSkyMaterial_property_energy_multiplier:
  51. .. rst-class:: classref-property
  52. :ref:`float<class_float>` **energy_multiplier** = ``1.0``
  53. .. rst-class:: classref-property-setget
  54. - void **set_energy_multiplier** **(** :ref:`float<class_float>` value **)**
  55. - :ref:`float<class_float>` **get_energy_multiplier** **(** **)**
  56. The sky's overall brightness multiplier. Higher values result in a brighter sky.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_PhysicalSkyMaterial_property_ground_color:
  60. .. rst-class:: classref-property
  61. :ref:`Color<class_Color>` **ground_color** = ``Color(0.1, 0.07, 0.034, 1)``
  62. .. rst-class:: classref-property-setget
  63. - void **set_ground_color** **(** :ref:`Color<class_Color>` value **)**
  64. - :ref:`Color<class_Color>` **get_ground_color** **(** **)**
  65. Modulates the :ref:`Color<class_Color>` on the bottom half of the sky to represent the ground.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_PhysicalSkyMaterial_property_mie_coefficient:
  69. .. rst-class:: classref-property
  70. :ref:`float<class_float>` **mie_coefficient** = ``0.005``
  71. .. rst-class:: classref-property-setget
  72. - void **set_mie_coefficient** **(** :ref:`float<class_float>` value **)**
  73. - :ref:`float<class_float>` **get_mie_coefficient** **(** **)**
  74. Controls the strength of `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__ for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_PhysicalSkyMaterial_property_mie_color:
  78. .. rst-class:: classref-property
  79. :ref:`Color<class_Color>` **mie_color** = ``Color(0.69, 0.729, 0.812, 1)``
  80. .. rst-class:: classref-property-setget
  81. - void **set_mie_color** **(** :ref:`Color<class_Color>` value **)**
  82. - :ref:`Color<class_Color>` **get_mie_color** **(** **)**
  83. Controls the :ref:`Color<class_Color>` of the `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__ effect. While not physically accurate, this allows for the creation of alien-looking planets.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_PhysicalSkyMaterial_property_mie_eccentricity:
  87. .. rst-class:: classref-property
  88. :ref:`float<class_float>` **mie_eccentricity** = ``0.8``
  89. .. rst-class:: classref-property-setget
  90. - void **set_mie_eccentricity** **(** :ref:`float<class_float>` value **)**
  91. - :ref:`float<class_float>` **get_mie_eccentricity** **(** **)**
  92. Controls the direction of the `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__. A value of ``1`` means that when light hits a particle it's passing through straight forward. A value of ``-1`` means that all light is scatter backwards.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_PhysicalSkyMaterial_property_night_sky:
  96. .. rst-class:: classref-property
  97. :ref:`Texture2D<class_Texture2D>` **night_sky**
  98. .. rst-class:: classref-property-setget
  99. - void **set_night_sky** **(** :ref:`Texture2D<class_Texture2D>` value **)**
  100. - :ref:`Texture2D<class_Texture2D>` **get_night_sky** **(** **)**
  101. :ref:`Texture2D<class_Texture2D>` for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_PhysicalSkyMaterial_property_rayleigh_coefficient:
  105. .. rst-class:: classref-property
  106. :ref:`float<class_float>` **rayleigh_coefficient** = ``2.0``
  107. .. rst-class:: classref-property-setget
  108. - void **set_rayleigh_coefficient** **(** :ref:`float<class_float>` value **)**
  109. - :ref:`float<class_float>` **get_rayleigh_coefficient** **(** **)**
  110. Controls the strength of the `Rayleigh scattering <https://en.wikipedia.org/wiki/Rayleigh_scattering>`__. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_PhysicalSkyMaterial_property_rayleigh_color:
  114. .. rst-class:: classref-property
  115. :ref:`Color<class_Color>` **rayleigh_color** = ``Color(0.3, 0.405, 0.6, 1)``
  116. .. rst-class:: classref-property-setget
  117. - void **set_rayleigh_color** **(** :ref:`Color<class_Color>` value **)**
  118. - :ref:`Color<class_Color>` **get_rayleigh_color** **(** **)**
  119. Controls the :ref:`Color<class_Color>` of the `Rayleigh scattering <https://en.wikipedia.org/wiki/Rayleigh_scattering>`__. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red :ref:`Color<class_Color>` results in a Mars-looking atmosphere with a corresponding blue sunset.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_PhysicalSkyMaterial_property_sun_disk_scale:
  123. .. rst-class:: classref-property
  124. :ref:`float<class_float>` **sun_disk_scale** = ``1.0``
  125. .. rst-class:: classref-property-setget
  126. - void **set_sun_disk_scale** **(** :ref:`float<class_float>` value **)**
  127. - :ref:`float<class_float>` **get_sun_disk_scale** **(** **)**
  128. Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_PhysicalSkyMaterial_property_turbidity:
  132. .. rst-class:: classref-property
  133. :ref:`float<class_float>` **turbidity** = ``10.0``
  134. .. rst-class:: classref-property-setget
  135. - void **set_turbidity** **(** :ref:`float<class_float>` value **)**
  136. - :ref:`float<class_float>` **get_turbidity** **(** **)**
  137. Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_PhysicalSkyMaterial_property_use_debanding:
  141. .. rst-class:: classref-property
  142. :ref:`bool<class_bool>` **use_debanding** = ``true``
  143. .. rst-class:: classref-property-setget
  144. - void **set_use_debanding** **(** :ref:`bool<class_bool>` value **)**
  145. - :ref:`bool<class_bool>` **get_use_debanding** **(** **)**
  146. 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.
  147. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  148. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  149. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  150. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  151. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  152. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  153. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`