class_physicalskymaterial.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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:`exposure<class_PhysicalSkyMaterial_property_exposure>` | ``0.1`` |
  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_exposure:
  44. - :ref:`float<class_float>` **exposure**
  45. +-----------+---------------------+
  46. | *Default* | ``0.1`` |
  47. +-----------+---------------------+
  48. | *Setter* | set_exposure(value) |
  49. +-----------+---------------------+
  50. | *Getter* | get_exposure() |
  51. +-----------+---------------------+
  52. Sets the exposure of the sky. Higher exposure values make the entire sky brighter.
  53. ----
  54. .. _class_PhysicalSkyMaterial_property_ground_color:
  55. - :ref:`Color<class_Color>` **ground_color**
  56. +-----------+--------------------------------+
  57. | *Default* | ``Color(0.1, 0.07, 0.034, 1)`` |
  58. +-----------+--------------------------------+
  59. | *Setter* | set_ground_color(value) |
  60. +-----------+--------------------------------+
  61. | *Getter* | get_ground_color() |
  62. +-----------+--------------------------------+
  63. Modulates the :ref:`Color<class_Color>` on the bottom half of the sky to represent the ground.
  64. ----
  65. .. _class_PhysicalSkyMaterial_property_mie_coefficient:
  66. - :ref:`float<class_float>` **mie_coefficient**
  67. +-----------+----------------------------+
  68. | *Default* | ``0.005`` |
  69. +-----------+----------------------------+
  70. | *Setter* | set_mie_coefficient(value) |
  71. +-----------+----------------------------+
  72. | *Getter* | get_mie_coefficient() |
  73. +-----------+----------------------------+
  74. 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.
  75. ----
  76. .. _class_PhysicalSkyMaterial_property_mie_color:
  77. - :ref:`Color<class_Color>` **mie_color**
  78. +-----------+----------------------------------+
  79. | *Default* | ``Color(0.69, 0.729, 0.812, 1)`` |
  80. +-----------+----------------------------------+
  81. | *Setter* | set_mie_color(value) |
  82. +-----------+----------------------------------+
  83. | *Getter* | get_mie_color() |
  84. +-----------+----------------------------------+
  85. Controls the :ref:`Color<class_Color>` of the mie scattering effect. While not physically accurate, this allows for the creation of alien-looking planets.
  86. ----
  87. .. _class_PhysicalSkyMaterial_property_mie_eccentricity:
  88. - :ref:`float<class_float>` **mie_eccentricity**
  89. +-----------+-----------------------------+
  90. | *Default* | ``0.8`` |
  91. +-----------+-----------------------------+
  92. | *Setter* | set_mie_eccentricity(value) |
  93. +-----------+-----------------------------+
  94. | *Getter* | get_mie_eccentricity() |
  95. +-----------+-----------------------------+
  96. 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.
  97. ----
  98. .. _class_PhysicalSkyMaterial_property_night_sky:
  99. - :ref:`Texture2D<class_Texture2D>` **night_sky**
  100. +----------+----------------------+
  101. | *Setter* | set_night_sky(value) |
  102. +----------+----------------------+
  103. | *Getter* | get_night_sky() |
  104. +----------+----------------------+
  105. :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.
  106. ----
  107. .. _class_PhysicalSkyMaterial_property_rayleigh_coefficient:
  108. - :ref:`float<class_float>` **rayleigh_coefficient**
  109. +-----------+---------------------------------+
  110. | *Default* | ``2.0`` |
  111. +-----------+---------------------------------+
  112. | *Setter* | set_rayleigh_coefficient(value) |
  113. +-----------+---------------------------------+
  114. | *Getter* | get_rayleigh_coefficient() |
  115. +-----------+---------------------------------+
  116. 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.
  117. ----
  118. .. _class_PhysicalSkyMaterial_property_rayleigh_color:
  119. - :ref:`Color<class_Color>` **rayleigh_color**
  120. +-----------+-------------------------------+
  121. | *Default* | ``Color(0.3, 0.405, 0.6, 1)`` |
  122. +-----------+-------------------------------+
  123. | *Setter* | set_rayleigh_color(value) |
  124. +-----------+-------------------------------+
  125. | *Getter* | get_rayleigh_color() |
  126. +-----------+-------------------------------+
  127. 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.
  128. ----
  129. .. _class_PhysicalSkyMaterial_property_sun_disk_scale:
  130. - :ref:`float<class_float>` **sun_disk_scale**
  131. +-----------+---------------------------+
  132. | *Default* | ``1.0`` |
  133. +-----------+---------------------------+
  134. | *Setter* | set_sun_disk_scale(value) |
  135. +-----------+---------------------------+
  136. | *Getter* | get_sun_disk_scale() |
  137. +-----------+---------------------------+
  138. Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth.
  139. ----
  140. .. _class_PhysicalSkyMaterial_property_turbidity:
  141. - :ref:`float<class_float>` **turbidity**
  142. +-----------+----------------------+
  143. | *Default* | ``10.0`` |
  144. +-----------+----------------------+
  145. | *Setter* | set_turbidity(value) |
  146. +-----------+----------------------+
  147. | *Getter* | get_turbidity() |
  148. +-----------+----------------------+
  149. Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere.
  150. ----
  151. .. _class_PhysicalSkyMaterial_property_use_debanding:
  152. - :ref:`bool<class_bool>` **use_debanding**
  153. +-----------+--------------------------+
  154. | *Default* | ``true`` |
  155. +-----------+--------------------------+
  156. | *Setter* | set_use_debanding(value) |
  157. +-----------+--------------------------+
  158. | *Getter* | get_use_debanding() |
  159. +-----------+--------------------------+
  160. 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.
  161. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  162. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  163. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  164. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  165. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  166. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`