class_sky.rst 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/Sky.xml.
  6. .. _class_Sky:
  7. Sky
  8. ===
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Defines a 3D environment's background by using a :ref:`Material<class_Material>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **Sky** class uses a :ref:`Material<class_Material>` to render a 3D environment's background and the light it emits by updating the reflection/radiance cubemaps.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +--------------------------------------------+--------------------------------------------------------+-------+
  21. | :ref:`ProcessMode<enum_Sky_ProcessMode>` | :ref:`process_mode<class_Sky_property_process_mode>` | ``0`` |
  22. +--------------------------------------------+--------------------------------------------------------+-------+
  23. | :ref:`RadianceSize<enum_Sky_RadianceSize>` | :ref:`radiance_size<class_Sky_property_radiance_size>` | ``3`` |
  24. +--------------------------------------------+--------------------------------------------------------+-------+
  25. | :ref:`Material<class_Material>` | :ref:`sky_material<class_Sky_property_sky_material>` | |
  26. +--------------------------------------------+--------------------------------------------------------+-------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Enumerations
  31. ------------
  32. .. _enum_Sky_RadianceSize:
  33. .. rst-class:: classref-enumeration
  34. enum **RadianceSize**:
  35. .. _class_Sky_constant_RADIANCE_SIZE_32:
  36. .. rst-class:: classref-enumeration-constant
  37. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_32** = ``0``
  38. Radiance texture size is 32×32 pixels.
  39. .. _class_Sky_constant_RADIANCE_SIZE_64:
  40. .. rst-class:: classref-enumeration-constant
  41. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_64** = ``1``
  42. Radiance texture size is 64×64 pixels.
  43. .. _class_Sky_constant_RADIANCE_SIZE_128:
  44. .. rst-class:: classref-enumeration-constant
  45. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_128** = ``2``
  46. Radiance texture size is 128×128 pixels.
  47. .. _class_Sky_constant_RADIANCE_SIZE_256:
  48. .. rst-class:: classref-enumeration-constant
  49. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_256** = ``3``
  50. Radiance texture size is 256×256 pixels.
  51. .. _class_Sky_constant_RADIANCE_SIZE_512:
  52. .. rst-class:: classref-enumeration-constant
  53. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_512** = ``4``
  54. Radiance texture size is 512×512 pixels.
  55. .. _class_Sky_constant_RADIANCE_SIZE_1024:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_1024** = ``5``
  58. Radiance texture size is 1024×1024 pixels.
  59. .. _class_Sky_constant_RADIANCE_SIZE_2048:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_2048** = ``6``
  62. Radiance texture size is 2048×2048 pixels.
  63. .. _class_Sky_constant_RADIANCE_SIZE_MAX:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_MAX** = ``7``
  66. Represents the size of the :ref:`RadianceSize<enum_Sky_RadianceSize>` enum.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _enum_Sky_ProcessMode:
  70. .. rst-class:: classref-enumeration
  71. enum **ProcessMode**:
  72. .. _class_Sky_constant_PROCESS_MODE_AUTOMATIC:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_AUTOMATIC** = ``0``
  75. Automatically selects the appropriate process mode based on your sky shader. If your shader uses ``TIME`` or ``POSITION``, this will use :ref:`PROCESS_MODE_REALTIME<class_Sky_constant_PROCESS_MODE_REALTIME>`. If your shader uses any of the ``LIGHT_*`` variables or any custom uniforms, this uses :ref:`PROCESS_MODE_INCREMENTAL<class_Sky_constant_PROCESS_MODE_INCREMENTAL>`. Otherwise, this defaults to :ref:`PROCESS_MODE_QUALITY<class_Sky_constant_PROCESS_MODE_QUALITY>`.
  76. .. _class_Sky_constant_PROCESS_MODE_QUALITY:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_QUALITY** = ``1``
  79. Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than :ref:`PROCESS_MODE_REALTIME<class_Sky_constant_PROCESS_MODE_REALTIME>` but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing :ref:`ProjectSettings.rendering/reflections/sky_reflections/ggx_samples<class_ProjectSettings_property_rendering/reflections/sky_reflections/ggx_samples>`.
  80. .. _class_Sky_constant_PROCESS_MODE_INCREMENTAL:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_INCREMENTAL** = ``2``
  83. Uses the same high quality importance sampling to process the radiance map as :ref:`PROCESS_MODE_QUALITY<class_Sky_constant_PROCESS_MODE_QUALITY>`, but updates over several frames. The number of frames is determined by :ref:`ProjectSettings.rendering/reflections/sky_reflections/roughness_layers<class_ProjectSettings_property_rendering/reflections/sky_reflections/roughness_layers>`. Use this when you need highest quality radiance maps, but have a sky that updates slowly.
  84. .. _class_Sky_constant_PROCESS_MODE_REALTIME:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_REALTIME** = ``3``
  87. Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on :ref:`ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality<class_ProjectSettings_property_rendering/reflections/sky_reflections/fast_filter_high_quality>`.
  88. \ **Note:** The fast filtering algorithm is limited to 256×256 cubemaps, so :ref:`radiance_size<class_Sky_property_radiance_size>` must be set to :ref:`RADIANCE_SIZE_256<class_Sky_constant_RADIANCE_SIZE_256>`. Otherwise, a warning is printed and the overridden radiance size is ignored.
  89. .. rst-class:: classref-section-separator
  90. ----
  91. .. rst-class:: classref-descriptions-group
  92. Property Descriptions
  93. ---------------------
  94. .. _class_Sky_property_process_mode:
  95. .. rst-class:: classref-property
  96. :ref:`ProcessMode<enum_Sky_ProcessMode>` **process_mode** = ``0``
  97. .. rst-class:: classref-property-setget
  98. - void **set_process_mode** **(** :ref:`ProcessMode<enum_Sky_ProcessMode>` value **)**
  99. - :ref:`ProcessMode<enum_Sky_ProcessMode>` **get_process_mode** **(** **)**
  100. Sets the method for generating the radiance map from the sky. The radiance map is a cubemap with increasingly blurry versions of the sky corresponding to different levels of roughness. Radiance maps can be expensive to calculate. See :ref:`ProcessMode<enum_Sky_ProcessMode>` for options.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_Sky_property_radiance_size:
  104. .. rst-class:: classref-property
  105. :ref:`RadianceSize<enum_Sky_RadianceSize>` **radiance_size** = ``3``
  106. .. rst-class:: classref-property-setget
  107. - void **set_radiance_size** **(** :ref:`RadianceSize<enum_Sky_RadianceSize>` value **)**
  108. - :ref:`RadianceSize<enum_Sky_RadianceSize>` **get_radiance_size** **(** **)**
  109. The **Sky**'s radiance map size. The higher the radiance map size, the more detailed the lighting from the **Sky** will be.
  110. See :ref:`RadianceSize<enum_Sky_RadianceSize>` constants for values.
  111. \ **Note:** Some hardware will have trouble with higher radiance sizes, especially :ref:`RADIANCE_SIZE_512<class_Sky_constant_RADIANCE_SIZE_512>` and above. Only use such high values on high-end hardware.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_Sky_property_sky_material:
  115. .. rst-class:: classref-property
  116. :ref:`Material<class_Material>` **sky_material**
  117. .. rst-class:: classref-property-setget
  118. - void **set_material** **(** :ref:`Material<class_Material>` value **)**
  119. - :ref:`Material<class_Material>` **get_material** **(** **)**
  120. :ref:`Material<class_Material>` used to draw the background. Can be :ref:`PanoramaSkyMaterial<class_PanoramaSkyMaterial>`, :ref:`ProceduralSkyMaterial<class_ProceduralSkyMaterial>`, :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>`, or even a :ref:`ShaderMaterial<class_ShaderMaterial>` if you want to use your own custom shader.
  121. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  122. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  123. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  124. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  125. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  126. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  127. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`