Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ProceduralSkyMaterial

繼承: Material < Resource < RefCounted < Object

以圖塊的形式向 TileSet 資源暴露一組場景。

說明

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 DirectionalLight3D nodes in the scene. This means that the suns are defined individually by the properties of their corresponding DirectionalLight3Ds and globally by sun_angle_max and 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 PhysicalSkyMaterial.

屬性

float

energy_multiplier

1.0

Color

ground_bottom_color

Color(0.2, 0.169, 0.133, 1)

float

ground_curve

0.02

float

ground_energy_multiplier

1.0

Color

ground_horizon_color

Color(0.6463, 0.6558, 0.6708, 1)

Texture2D

sky_cover

Color

sky_cover_modulate

Color(1, 1, 1, 1)

float

sky_curve

0.15

float

sky_energy_multiplier

1.0

Color

sky_horizon_color

Color(0.6463, 0.6558, 0.6708, 1)

Color

sky_top_color

Color(0.385, 0.454, 0.55, 1)

float

sun_angle_max

30.0

float

sun_curve

0.15

bool

use_debanding

true


屬性說明

float energy_multiplier = 1.0 🔗

  • void set_energy_multiplier(value: float)

  • float get_energy_multiplier()

天空整體亮度的乘數。數值越高,天空就越亮。


Color ground_bottom_color = Color(0.2, 0.169, 0.133, 1) 🔗

  • void set_ground_bottom_color(value: Color)

  • Color get_ground_bottom_color()

地面底部的顏色。會與 ground_horizon_color 混合。


float ground_curve = 0.02 🔗

  • void set_ground_curve(value: float)

  • float get_ground_curve()

ground_horizon_color 漸變到 ground_bottom_color 的速度。


float ground_energy_multiplier = 1.0 🔗

  • void set_ground_energy_multiplier(value: float)

  • float get_ground_energy_multiplier()

地面顏色的乘數。值越高,地面越亮。


Color ground_horizon_color = Color(0.6463, 0.6558, 0.6708, 1) 🔗

  • void set_ground_horizon_color(value: Color)

  • Color get_ground_horizon_color()

地面在地平線處的顏色。會與 ground_bottom_color 混合。


Texture2D sky_cover 🔗

要使用的天空覆蓋紋理。這個紋理必須使用一個等角投影(類似於PanoramaSkyMaterial)。 該紋理的顏色將被新增到現有的天空顏色中,並將乘以 sky_energy_multipliersky_cover_modulate。這主要適用於顯示夜晚的星星,但也可以用來顯示白天或夜晚的雲彩(具有非物理精確性的外觀)。


Color sky_cover_modulate = Color(1, 1, 1, 1) 🔗

  • void set_sky_cover_modulate(value: Color)

  • Color get_sky_cover_modulate()

套用於 sky_cover 紋理的色調。可用於改變天空覆蓋的顏色或不透明度,不受天空能量的影響,對於晝夜轉換或天氣轉換很有用。只有在 sky_cover 中定義了紋理時才有效。


float sky_curve = 0.15 🔗

  • void set_sky_curve(value: float)

  • float get_sky_curve()

sky_horizon_color 漸變到 sky_top_color 的速度。


float sky_energy_multiplier = 1.0 🔗

  • void set_sky_energy_multiplier(value: float)

  • float get_sky_energy_multiplier()

天空顏色的倍數。值越高天空越亮。


Color sky_horizon_color = Color(0.6463, 0.6558, 0.6708, 1) 🔗

  • void set_sky_horizon_color(value: Color)

  • Color get_sky_horizon_color()

天空在地平線處的顏色。會與 sky_top_color 混合。


Color sky_top_color = Color(0.385, 0.454, 0.55, 1) 🔗

  • void set_sky_top_color(value: Color)

  • Color get_sky_top_color()

天空在頂部的顏色。會與 sky_horizon_color 混合。


float sun_angle_max = 30.0 🔗

  • void set_sun_angle_max(value: float)

  • float get_sun_angle_max()

太陽完全淡出消失的位置與太陽中心的距離。


float sun_curve = 0.15 🔗

  • void set_sun_curve(value: float)

  • float get_sun_curve()

在太陽圓盤邊緣和 sun_angle_max 之間,太陽消失得有多快。


bool use_debanding = true 🔗

  • void set_use_debanding(value: bool)

  • bool get_use_debanding()

如果為 true,則啟用去色帶。去色帶會增加少量噪點,這有助於減少天空中顏色的平滑變化而出現的色帶。