class_physicalskymaterial.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. :ref:`Sky<class_Sky>` :ref:`Material<class_Material>` used for a physically based sky.
  11. Description
  12. -----------
  13. 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.
  14. 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.
  15. 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.
  16. Properties
  17. ----------
  18. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  19. | :ref:`float<class_float>` | :ref:`energy_multiplier<class_PhysicalSkyMaterial_property_energy_multiplier>` | ``1.0`` |
  20. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  21. | :ref:`Color<class_Color>` | :ref:`ground_color<class_PhysicalSkyMaterial_property_ground_color>` | ``Color(0.1, 0.07, 0.034, 1)`` |
  22. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  23. | :ref:`float<class_float>` | :ref:`mie_coefficient<class_PhysicalSkyMaterial_property_mie_coefficient>` | ``0.005`` |
  24. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  25. | :ref:`Color<class_Color>` | :ref:`mie_color<class_PhysicalSkyMaterial_property_mie_color>` | ``Color(0.69, 0.729, 0.812, 1)`` |
  26. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  27. | :ref:`float<class_float>` | :ref:`mie_eccentricity<class_PhysicalSkyMaterial_property_mie_eccentricity>` | ``0.8`` |
  28. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  29. | :ref:`Texture2D<class_Texture2D>` | :ref:`night_sky<class_PhysicalSkyMaterial_property_night_sky>` | |
  30. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  31. | :ref:`float<class_float>` | :ref:`rayleigh_coefficient<class_PhysicalSkyMaterial_property_rayleigh_coefficient>` | ``2.0`` |
  32. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  33. | :ref:`Color<class_Color>` | :ref:`rayleigh_color<class_PhysicalSkyMaterial_property_rayleigh_color>` | ``Color(0.3, 0.405, 0.6, 1)`` |
  34. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  35. | :ref:`float<class_float>` | :ref:`sun_disk_scale<class_PhysicalSkyMaterial_property_sun_disk_scale>` | ``1.0`` |
  36. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  37. | :ref:`float<class_float>` | :ref:`turbidity<class_PhysicalSkyMaterial_property_turbidity>` | ``10.0`` |
  38. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_PhysicalSkyMaterial_property_use_debanding>` | ``true`` |
  40. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  41. Property Descriptions
  42. ---------------------
  43. .. _class_PhysicalSkyMaterial_property_energy_multiplier:
  44. - :ref:`float<class_float>` **energy_multiplier**
  45. +-----------+------------------------------+
  46. | *Default* | ``1.0`` |
  47. +-----------+------------------------------+
  48. | *Setter* | set_energy_multiplier(value) |
  49. +-----------+------------------------------+
  50. | *Getter* | get_energy_multiplier() |
  51. +-----------+------------------------------+
  52. ----
  53. .. _class_PhysicalSkyMaterial_property_ground_color:
  54. - :ref:`Color<class_Color>` **ground_color**
  55. +-----------+--------------------------------+
  56. | *Default* | ``Color(0.1, 0.07, 0.034, 1)`` |
  57. +-----------+--------------------------------+
  58. | *Setter* | set_ground_color(value) |
  59. +-----------+--------------------------------+
  60. | *Getter* | get_ground_color() |
  61. +-----------+--------------------------------+
  62. Modulates the :ref:`Color<class_Color>` on the bottom half of the sky to represent the ground.
  63. ----
  64. .. _class_PhysicalSkyMaterial_property_mie_coefficient:
  65. - :ref:`float<class_float>` **mie_coefficient**
  66. +-----------+----------------------------+
  67. | *Default* | ``0.005`` |
  68. +-----------+----------------------------+
  69. | *Setter* | set_mie_coefficient(value) |
  70. +-----------+----------------------------+
  71. | *Getter* | get_mie_coefficient() |
  72. +-----------+----------------------------+
  73. Controls the strength of 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.
  74. ----
  75. .. _class_PhysicalSkyMaterial_property_mie_color:
  76. - :ref:`Color<class_Color>` **mie_color**
  77. +-----------+----------------------------------+
  78. | *Default* | ``Color(0.69, 0.729, 0.812, 1)`` |
  79. +-----------+----------------------------------+
  80. | *Setter* | set_mie_color(value) |
  81. +-----------+----------------------------------+
  82. | *Getter* | get_mie_color() |
  83. +-----------+----------------------------------+
  84. Controls the :ref:`Color<class_Color>` of the mie scattering effect. While not physically accurate, this allows for the creation of alien-looking planets.
  85. ----
  86. .. _class_PhysicalSkyMaterial_property_mie_eccentricity:
  87. - :ref:`float<class_float>` **mie_eccentricity**
  88. +-----------+-----------------------------+
  89. | *Default* | ``0.8`` |
  90. +-----------+-----------------------------+
  91. | *Setter* | set_mie_eccentricity(value) |
  92. +-----------+-----------------------------+
  93. | *Getter* | get_mie_eccentricity() |
  94. +-----------+-----------------------------+
  95. Controls the direction of the 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.
  96. ----
  97. .. _class_PhysicalSkyMaterial_property_night_sky:
  98. - :ref:`Texture2D<class_Texture2D>` **night_sky**
  99. +----------+----------------------+
  100. | *Setter* | set_night_sky(value) |
  101. +----------+----------------------+
  102. | *Getter* | get_night_sky() |
  103. +----------+----------------------+
  104. :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.
  105. ----
  106. .. _class_PhysicalSkyMaterial_property_rayleigh_coefficient:
  107. - :ref:`float<class_float>` **rayleigh_coefficient**
  108. +-----------+---------------------------------+
  109. | *Default* | ``2.0`` |
  110. +-----------+---------------------------------+
  111. | *Setter* | set_rayleigh_coefficient(value) |
  112. +-----------+---------------------------------+
  113. | *Getter* | get_rayleigh_coefficient() |
  114. +-----------+---------------------------------+
  115. Controls the strength of the Rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
  116. ----
  117. .. _class_PhysicalSkyMaterial_property_rayleigh_color:
  118. - :ref:`Color<class_Color>` **rayleigh_color**
  119. +-----------+-------------------------------+
  120. | *Default* | ``Color(0.3, 0.405, 0.6, 1)`` |
  121. +-----------+-------------------------------+
  122. | *Setter* | set_rayleigh_color(value) |
  123. +-----------+-------------------------------+
  124. | *Getter* | get_rayleigh_color() |
  125. +-----------+-------------------------------+
  126. Controls the :ref:`Color<class_Color>` of the 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.
  127. ----
  128. .. _class_PhysicalSkyMaterial_property_sun_disk_scale:
  129. - :ref:`float<class_float>` **sun_disk_scale**
  130. +-----------+---------------------------+
  131. | *Default* | ``1.0`` |
  132. +-----------+---------------------------+
  133. | *Setter* | set_sun_disk_scale(value) |
  134. +-----------+---------------------------+
  135. | *Getter* | get_sun_disk_scale() |
  136. +-----------+---------------------------+
  137. Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth.
  138. ----
  139. .. _class_PhysicalSkyMaterial_property_turbidity:
  140. - :ref:`float<class_float>` **turbidity**
  141. +-----------+----------------------+
  142. | *Default* | ``10.0`` |
  143. +-----------+----------------------+
  144. | *Setter* | set_turbidity(value) |
  145. +-----------+----------------------+
  146. | *Getter* | get_turbidity() |
  147. +-----------+----------------------+
  148. Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere.
  149. ----
  150. .. _class_PhysicalSkyMaterial_property_use_debanding:
  151. - :ref:`bool<class_bool>` **use_debanding**
  152. +-----------+--------------------------+
  153. | *Default* | ``true`` |
  154. +-----------+--------------------------+
  155. | *Setter* | set_use_debanding(value) |
  156. +-----------+--------------------------+
  157. | *Getter* | get_use_debanding() |
  158. +-----------+--------------------------+
  159. 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.
  160. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  161. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  162. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  163. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  164. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  165. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`