123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Sky.xml.
- .. _class_Sky:
- Sky
- ===
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Defines a 3D environment's background by using a :ref:`Material<class_Material>`.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +--------------------------------------------+--------------------------------------------------------+-------+
- | :ref:`ProcessMode<enum_Sky_ProcessMode>` | :ref:`process_mode<class_Sky_property_process_mode>` | ``0`` |
- +--------------------------------------------+--------------------------------------------------------+-------+
- | :ref:`RadianceSize<enum_Sky_RadianceSize>` | :ref:`radiance_size<class_Sky_property_radiance_size>` | ``3`` |
- +--------------------------------------------+--------------------------------------------------------+-------+
- | :ref:`Material<class_Material>` | :ref:`sky_material<class_Sky_property_sky_material>` | |
- +--------------------------------------------+--------------------------------------------------------+-------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_Sky_RadianceSize:
- .. rst-class:: classref-enumeration
- enum **RadianceSize**: :ref:`🔗<enum_Sky_RadianceSize>`
- .. _class_Sky_constant_RADIANCE_SIZE_32:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_32** = ``0``
- Radiance texture size is 32×32 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_64:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_64** = ``1``
- Radiance texture size is 64×64 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_128:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_128** = ``2``
- Radiance texture size is 128×128 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_256:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_256** = ``3``
- Radiance texture size is 256×256 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_512:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_512** = ``4``
- Radiance texture size is 512×512 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_1024:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_1024** = ``5``
- Radiance texture size is 1024×1024 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_2048:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_2048** = ``6``
- Radiance texture size is 2048×2048 pixels.
- .. _class_Sky_constant_RADIANCE_SIZE_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **RADIANCE_SIZE_MAX** = ``7``
- Represents the size of the :ref:`RadianceSize<enum_Sky_RadianceSize>` enum.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_Sky_ProcessMode:
- .. rst-class:: classref-enumeration
- enum **ProcessMode**: :ref:`🔗<enum_Sky_ProcessMode>`
- .. _class_Sky_constant_PROCESS_MODE_AUTOMATIC:
- .. rst-class:: classref-enumeration-constant
- :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_AUTOMATIC** = ``0``
- 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>`.
- .. _class_Sky_constant_PROCESS_MODE_QUALITY:
- .. rst-class:: classref-enumeration-constant
- :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_QUALITY** = ``1``
- 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>`.
- .. _class_Sky_constant_PROCESS_MODE_INCREMENTAL:
- .. rst-class:: classref-enumeration-constant
- :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_INCREMENTAL** = ``2``
- 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.
- .. _class_Sky_constant_PROCESS_MODE_REALTIME:
- .. rst-class:: classref-enumeration-constant
- :ref:`ProcessMode<enum_Sky_ProcessMode>` **PROCESS_MODE_REALTIME** = ``3``
- 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>`.
- \ **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.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Sky_property_process_mode:
- .. rst-class:: classref-property
- :ref:`ProcessMode<enum_Sky_ProcessMode>` **process_mode** = ``0`` :ref:`🔗<class_Sky_property_process_mode>`
- .. rst-class:: classref-property-setget
- - |void| **set_process_mode**\ (\ value\: :ref:`ProcessMode<enum_Sky_ProcessMode>`\ )
- - :ref:`ProcessMode<enum_Sky_ProcessMode>` **get_process_mode**\ (\ )
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Sky_property_radiance_size:
- .. rst-class:: classref-property
- :ref:`RadianceSize<enum_Sky_RadianceSize>` **radiance_size** = ``3`` :ref:`🔗<class_Sky_property_radiance_size>`
- .. rst-class:: classref-property-setget
- - |void| **set_radiance_size**\ (\ value\: :ref:`RadianceSize<enum_Sky_RadianceSize>`\ )
- - :ref:`RadianceSize<enum_Sky_RadianceSize>` **get_radiance_size**\ (\ )
- The **Sky**'s radiance map size. The higher the radiance map size, the more detailed the lighting from the **Sky** will be.
- See :ref:`RadianceSize<enum_Sky_RadianceSize>` constants for values.
- \ **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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Sky_property_sky_material:
- .. rst-class:: classref-property
- :ref:`Material<class_Material>` **sky_material** :ref:`🔗<class_Sky_property_sky_material>`
- .. rst-class:: classref-property-setget
- - |void| **set_material**\ (\ value\: :ref:`Material<class_Material>`\ )
- - :ref:`Material<class_Material>` **get_material**\ (\ )
- :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.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|