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.
Checking the stable version of the documentation...
Sky
繼承: Resource < RefCounted < Object
使用 Material 定義 3D 環境的背景。
說明
Sky 類使用 Material 來繪製背景,會更新反射/輻照度立方體貼圖。
屬性
|
||
|
||
列舉
enum RadianceSize: 🔗
RadianceSize RADIANCE_SIZE_32 = 0
輻照度紋理尺寸為 32×32 圖元。
RadianceSize RADIANCE_SIZE_64 = 1
輻照度紋理尺寸為 64×64 圖元。
RadianceSize RADIANCE_SIZE_128 = 2
輻照度紋理尺寸為128×128圖元。
RadianceSize RADIANCE_SIZE_256 = 3
輻照度紋理尺寸為 256×256 圖元。
RadianceSize RADIANCE_SIZE_512 = 4
輻照度紋理尺寸為 512×512 圖元。
RadianceSize RADIANCE_SIZE_1024 = 5
輻照度紋理尺寸為 1024×1024 圖元。
RadianceSize RADIANCE_SIZE_2048 = 6
輻照度紋理尺寸為 2048×2048 圖元。
RadianceSize RADIANCE_SIZE_MAX = 7
代表 RadianceSize 列舉的大小。
enum ProcessMode: 🔗
ProcessMode PROCESS_MODE_AUTOMATIC = 0
根據天空著色器自動選擇合適的處理模式。如果著色器使用 TIME 或 POSITION,這將使用 PROCESS_MODE_REALTIME。如果著色器使用任何 LIGHT_* 變數或任何自訂 uniform,這將使用 PROCESS_MODE_INCREMENTAL。否則,這預設為 PROCESS_MODE_QUALITY。
ProcessMode PROCESS_MODE_QUALITY = 1
使用高品質重要性取樣處理輻照度貼圖。得到的結果通常比 PROCESS_MODE_REALTIME 的品質更高,但需要花費更多的時間來生成。如果你計畫在運行時修改天空,則不應使用。如果你發現反射不夠模糊,出現了火花或者螢火蟲,請嘗試增大 ProjectSettings.rendering/reflections/sky_reflections/ggx_samples。
ProcessMode PROCESS_MODE_INCREMENTAL = 2
使用與 PROCESS_MODE_QUALITY 相同的高品質重要性取樣來處理輻照度貼圖,但更新會佔用幾影格。影格數由 ProjectSettings.rendering/reflections/sky_reflections/roughness_layers 決定。當需要最高品質的輻照度貼圖,但天空更新緩慢時,請使用該選項。
ProcessMode PROCESS_MODE_REALTIME = 3
使用快速篩選演算法處理輻射度貼圖。一般來說,這會導致品質較低,但執行時間會大大加快。如果需要更好的品質,但仍需要每影格更新天空,請考慮開啟 ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality。
注意:快速篩選演算法被限制為 256x256 立方體貼圖,因此必須將 radiance_size 設定為 RADIANCE_SIZE_256。否則會輸出警告並忽略覆蓋的輻射度大小。
屬性說明
ProcessMode process_mode = 0 🔗
void set_process_mode(value: ProcessMode)
ProcessMode get_process_mode()
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.
RadianceSize radiance_size = 3 🔗
void set_radiance_size(value: RadianceSize)
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.
Note: Some hardware will have trouble with higher radiance sizes, especially RADIANCE_SIZE_512 and above. Only use such high values on high-end hardware.
用於繪製該背景的 Material。可以是 PanoramaSkyMaterial、ProceduralSkyMaterial、PhysicalSkyMaterial,如果你想使用自訂著色器也可以是 ShaderMaterial。