Skip to content

Latest commit

 

History

History
296 lines (175 loc) · 14.8 KB

class_proceduralskymaterial.rst

File metadata and controls

296 lines (175 loc) · 14.8 KB
github_url:hide

ProceduralSkyMaterial

Inherits: :ref:`Material<class_Material>` < :ref:`Resource<class_Resource>` < :ref:`RefCounted<class_RefCounted>` < :ref:`Object<class_Object>`

A material that defines a simple sky for a :ref:`Sky<class_Sky>` resource.

.. rst-class:: classref-introduction-group

Description

ProceduralSkyMaterial provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are defined by a main color, a color at the horizon, and an easing curve to interpolate between them. Suns are described by a position in the sky, a color, and a max angle from the sun at which the easing curve ends. The max angle therefore defines the size of the sun in the sky.

ProceduralSkyMaterial supports up to 4 suns, using the color, and energy, direction, and angular distance of the first four :ref:`DirectionalLight3D<class_DirectionalLight3D>` nodes in the scene. This means that the suns are defined individually by the properties of their corresponding :ref:`DirectionalLight3D<class_DirectionalLight3D>`s and globally by :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>` and :ref:`sun_curve<class_ProceduralSkyMaterial_property_sun_curve>`.

ProceduralSkyMaterial uses a lightweight shader to draw the sky and is therefore suited for real time updates. This makes it a great option for a sky that is simple and computationally cheap, but unrealistic. If you need a more realistic procedural option, use :ref:`PhysicalSkyMaterial<class_PhysicalSkyMaterial>`.

.. rst-class:: classref-reftable-group

Properties

:ref:`Color<class_Color>` :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>` Color(0.2, 0.169, 0.133, 1)
:ref:`float<class_float>` :ref:`ground_curve<class_ProceduralSkyMaterial_property_ground_curve>` 0.02
:ref:`float<class_float>` :ref:`ground_energy_multiplier<class_ProceduralSkyMaterial_property_ground_energy_multiplier>` 1.0
:ref:`Color<class_Color>` :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>` Color(0.6463, 0.6558, 0.6708, 1)
:ref:`Texture2D<class_Texture2D>` :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>`  
:ref:`Color<class_Color>` :ref:`sky_cover_modulate<class_ProceduralSkyMaterial_property_sky_cover_modulate>` Color(1, 1, 1, 1)
:ref:`float<class_float>` :ref:`sky_curve<class_ProceduralSkyMaterial_property_sky_curve>` 0.15
:ref:`float<class_float>` :ref:`sky_energy_multiplier<class_ProceduralSkyMaterial_property_sky_energy_multiplier>` 1.0
:ref:`Color<class_Color>` :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>` Color(0.6463, 0.6558, 0.6708, 1)
:ref:`Color<class_Color>` :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>` Color(0.385, 0.454, 0.55, 1)
:ref:`float<class_float>` :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>` 30.0
:ref:`float<class_float>` :ref:`sun_curve<class_ProceduralSkyMaterial_property_sun_curve>` 0.15
:ref:`bool<class_bool>` :ref:`use_debanding<class_ProceduralSkyMaterial_property_use_debanding>` true
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Property Descriptions

.. rst-class:: classref-property

:ref:`Color<class_Color>` ground_bottom_color = Color(0.2, 0.169, 0.133, 1)

.. rst-class:: classref-property-setget

Color of the ground at the bottom. Blends with :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` ground_curve = 0.02

.. rst-class:: classref-property-setget

How quickly the :ref:`ground_horizon_color<class_ProceduralSkyMaterial_property_ground_horizon_color>` fades into the :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` ground_energy_multiplier = 1.0

.. rst-class:: classref-property-setget

Multiplier for ground color. A higher value will make the ground brighter.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Color<class_Color>` ground_horizon_color = Color(0.6463, 0.6558, 0.6708, 1)

.. rst-class:: classref-property-setget

Color of the ground at the horizon. Blends with :ref:`ground_bottom_color<class_ProceduralSkyMaterial_property_ground_bottom_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Texture2D<class_Texture2D>` sky_cover

.. rst-class:: classref-property-setget

The sky cover texture to use. This texture must use an equirectangular projection (similar to :ref:`PanoramaSkyMaterial<class_PanoramaSkyMaterial>`). The texture's colors will be added to the existing sky color, and will be multiplied by :ref:`sky_energy_multiplier<class_ProceduralSkyMaterial_property_sky_energy_multiplier>` and :ref:`sky_cover_modulate<class_ProceduralSkyMaterial_property_sky_cover_modulate>`. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look).

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Color<class_Color>` sky_cover_modulate = Color(1, 1, 1, 1)

.. rst-class:: classref-property-setget

The tint to apply to the :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>` texture. This can be used to change the sky cover's colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined in :ref:`sky_cover<class_ProceduralSkyMaterial_property_sky_cover>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` sky_curve = 0.15

.. rst-class:: classref-property-setget

How quickly the :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>` fades into the :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` sky_energy_multiplier = 1.0

.. rst-class:: classref-property-setget

Multiplier for sky color. A higher value will make the sky brighter.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Color<class_Color>` sky_horizon_color = Color(0.6463, 0.6558, 0.6708, 1)

.. rst-class:: classref-property-setget

Color of the sky at the horizon. Blends with :ref:`sky_top_color<class_ProceduralSkyMaterial_property_sky_top_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Color<class_Color>` sky_top_color = Color(0.385, 0.454, 0.55, 1)

.. rst-class:: classref-property-setget

Color of the sky at the top. Blends with :ref:`sky_horizon_color<class_ProceduralSkyMaterial_property_sky_horizon_color>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` sun_angle_max = 30.0

.. rst-class:: classref-property-setget

Distance from center of sun where it fades out completely.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`float<class_float>` sun_curve = 0.15

.. rst-class:: classref-property-setget

How quickly the sun fades away between the edge of the sun disk and :ref:`sun_angle_max<class_ProceduralSkyMaterial_property_sun_angle_max>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` use_debanding = true

.. rst-class:: classref-property-setget

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.