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...
Environment
繼承: Resource < RefCounted < Object
定義算繪選項的資源,用於環境節點(例如 WorldEnvironment)。
說明
Resource for environment nodes (like WorldEnvironment) that define multiple environment operations (such as background Sky or Color, ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is:
Depth of Field Blur
Auto Exposure
Glow
Tonemap
Adjustments
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
get_glow_level(idx: int) const |
|
void |
set_glow_level(idx: int, intensity: float) |
列舉
enum BGMode: 🔗
BGMode BG_CLEAR_COLOR = 0
使用 ProjectSettings.rendering/environment/defaults/default_clear_color 中定義的清除顏色來清除背景。
BGMode BG_COLOR = 1
使用自訂的清除顏色來清除背景。
BGMode BG_SKY = 2
在背景中顯示使用者自訂的天空。
BGMode BG_CANVAS = 3
在背景中顯示 CanvasLayer。
BGMode BG_KEEP = 4
在螢幕上保留在背景中繪製的每個圖元。這是最快的背景模式,但它只能安全地用在完全室內的場景(沒有可見的天空或天空反射)。如果在背景可見的場景中啟用,則移動相機時,將看到“鬼影蹤跡”偽影。
BGMode BG_CAMERA_FEED = 5
在背景中顯示相機源。
BGMode BG_MAX = 6
代表 BGMode 列舉的大小。
enum AmbientSource: 🔗
AmbientSource AMBIENT_SOURCE_BG = 0
從指定為背景的任何來源收集環境光。
AmbientSource AMBIENT_SOURCE_DISABLED = 1
禁用環境光。這比 AMBIENT_SOURCE_SKY 提供了輕微的性能提升。
AmbientSource AMBIENT_SOURCE_COLOR = 2
為環境光指定特定的 Color。與 AMBIENT_SOURCE_SKY 相比,這提供了輕微的性能提升。
AmbientSource AMBIENT_SOURCE_SKY = 3
無論背景如何,都從 Sky 收集環境光。
enum ReflectionSource: 🔗
ReflectionSource REFLECTION_SOURCE_BG = 0
使用背景進行反射。
ReflectionSource REFLECTION_SOURCE_DISABLED = 1
禁用反射。與其他選項相比,這提供了輕微的性能提升。
ReflectionSource REFLECTION_SOURCE_SKY = 2
無論背景如何,都使用 Sky 進行反射。
enum ToneMapper: 🔗
ToneMapper TONE_MAPPER_LINEAR = 0
Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper.
ToneMapper TONE_MAPPER_REINHARDT = 1
A simple tonemapping curve that rolls off bright values to prevent clipping. This results in an image that can appear dull and low contrast. Slower than TONE_MAPPER_LINEAR.
Note: When tonemap_white is left at the default value of 1.0, TONE_MAPPER_REINHARDT produces an identical image to TONE_MAPPER_LINEAR.
ToneMapper TONE_MAPPER_FILMIC = 2
Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than TONE_MAPPER_REINHARDT. Slightly slower than TONE_MAPPER_REINHARDT.
Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.
ToneMapper TONE_MAPPER_ACES = 3
Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than TONE_MAPPER_FILMIC.
Note: This tonemapping operator is called "ACES Fitted" in Godot 3.x.
Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.
ToneMapper TONE_MAPPER_AGX = 4
Uses an adjustable film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option.
enum GlowBlendMode: 🔗
GlowBlendMode GLOW_BLEND_MODE_ADDITIVE = 0
Adds the glow effect to the scene.
GlowBlendMode GLOW_BLEND_MODE_SCREEN = 1
Adds the glow effect to the scene after modifying the glow influence based on the scene value; dark values will be highly influenced by glow and bright values will not be influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. tonemap_white is used to determine the maximum scene value where the glow should have no influence. When tonemap_mode is set to TONE_MAPPER_LINEAR and Viewport.use_hdr_2d is true, the parent window's Window.get_output_max_linear_value() will be used as the maximum scene value.
GlowBlendMode GLOW_BLEND_MODE_SOFTLIGHT = 2
Adds the glow effect to the tonemapped image after modifying the glow influence based on the image value; dark values and bright values will not be influenced by glow and mid-range values will be highly influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. The glow will have the largest influence on image values of 0.25 and will have no influence when applied to image values greater than 1.0.
Note: This blend mode does not support HDR output because expects a maximum output value of 1.0. It is recommended to use a different blend mode when rendering to an HDR screen.
GlowBlendMode GLOW_BLEND_MODE_REPLACE = 3
Replaces all pixels' color by the glow effect. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness or to preview glow configuration in the editor.
GlowBlendMode GLOW_BLEND_MODE_MIX = 4
Mixes the glow image with the scene image. Best used with glow_bloom to avoid darkening the scene.
enum FogMode: 🔗
FogMode FOG_MODE_EXPONENTIAL = 0
Use a physically-based fog model defined primarily by fog density.
FogMode FOG_MODE_DEPTH = 1
Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control.
enum SDFGIYScale: 🔗
SDFGIYScale SDFGI_Y_SCALE_50_PERCENT = 0
在 Y(垂直)軸上對 SDFGI 使用 50% 的縮放。SDFGI 儲存格將比它們的寬度短兩倍。這允許提供更多的 GI 細節,並減少薄地板和天花板的漏光。這通常是垂直度不高的場景的最佳選擇。
SDFGIYScale SDFGI_Y_SCALE_75_PERCENT = 1
在 Y(垂直)軸上為 SDFGI 使用 75% 的縮放。這是 50% 和 100% SDFGI Y 縮放之間的平衡。
SDFGIYScale SDFGI_Y_SCALE_100_PERCENT = 2
在 Y(垂直)軸上為 SDFGI 使用 100% 的縮放。SDFGI 儲存格將與寬度一樣高。這通常是高度垂直場景的最佳選擇。不利之處在於,薄地板和天花板可能會導致漏光更加明顯。
屬性說明
float adjustment_brightness = 1.0 🔗
Applies a simple brightness adjustment to the rendered image after tonemaping. To adjust scene brightness use tonemap_exposure instead, which is applied before tonemapping and thus less prone to issues with bright colors. Effective only if adjustment_enabled is true.
Texture adjustment_color_correction 🔗
The Texture2D or Texture3D lookup table (LUT) to use for the built-in post-process color grading. Can use a GradientTexture1D for a 1-dimensional LUT, or a Texture3D for a more complex LUT. Effective only if adjustment_enabled is true.
Note: Color correction does not currently support HDR output due to only supporting values in the SDR (0.0 to 1.0) range.
float adjustment_contrast = 1.0 🔗
Increasing adjustment_contrast will make dark values darker and bright values brighter. This simple adjustment is applied to the rendered image after tonemaping. When set to a value greater than 1.0, adjustment_contrast is prone to clipping colors that become too bright or too dark. Effective only if adjustment_enabled is true.
bool adjustment_enabled = false 🔗
If true, enables the adjustment_* properties provided by this resource. If false, modifications to the adjustment_* properties will have no effect on the rendered scene.
float adjustment_saturation = 1.0 🔗
Applies a simple saturation adjustment to the rendered image after tonemaping. When adjustment_saturation is set to 0.0, the rendered image will be fully converted to a grayscale image. Effective only if adjustment_enabled is true.
Color ambient_light_color = Color(0, 0, 0, 1) 🔗
環境光的 Color。僅當 ambient_light_sky_contribution 低於 1.0(不包括)時,才有效。
float ambient_light_energy = 1.0 🔗
環境光的能量。值越高,光線越強。僅當 ambient_light_sky_contribution 低於 1.0(不包括)時,才有效。
float ambient_light_sky_contribution = 1.0 🔗
定義天空給場景帶來的光照量。值為 0.0 表示天空的發光對場景照明沒有影響,因此所有的環境照明都由環境光提供。相反,值為 1.0 表示所有影響場景的光線都由天空提供,因此環境光參數對場景沒有影響。
注意:內部會將 ambient_light_sky_contribution 限制在 0.0 到 1.0 之間(閉區間)。
AmbientSource ambient_light_source = 0 🔗
void set_ambient_source(value: AmbientSource)
AmbientSource get_ambient_source()
環境光源,用於算繪材質和全域照明。
int background_camera_feed_id = 1 🔗
在背景中顯示的相機源的 ID。
int background_canvas_max_layer = 0 🔗
要顯示的最大圖層 ID。只有在使用 BG_CANVAS 背景模式時有效。
Color background_color = Color(0, 0, 0, 1) 🔗
場景中清除區域顯示的 Color。僅在使用 BG_COLOR 背景模式時有效。
float background_energy_multiplier = 1.0 🔗
背景能量的倍數。增加可以使背景更亮,減少可以使背景更暗。
float background_intensity = 30000.0 🔗
背景的亮度,單位是尼特(坎德拉/平方米)。僅當啟用 ProjectSettings.rendering/lights_and_shadows/use_physical_light_units 時使用。預設值大致相當於正午時分的天空。
The background mode.
float fog_aerial_perspective = 0.0 🔗
If set above 0.0 (exclusive), blends between the fog's color and the color of the background Sky, as read from the radiance cubemap. This has a small performance cost when set above 0.0. Must have background_mode set to BG_SKY.
This is useful to simulate aerial perspective in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to 1.0, the fog color comes completely from the Sky. If set to 0.0, aerial perspective is disabled.
Notice that this does not sample the Sky directly, but rather the radiance cubemap. The cubemap is sampled at a mipmap level depending on the depth of the rendered pixel; the farther away, the higher the resolution of the sampled mipmap. This results in the actual color being a blurred version of the sky, with more blur closer to the camera. The highest mipmap resolution is used at a depth of Camera3D.far.
The fog density to be used. This is demonstrated in different ways depending on the fog_mode mode chosen:
Exponential Fog Mode: Higher values result in denser fog. The fog rendering is exponential like in real life.
Depth Fog mode: The maximum intensity of the deep fog, effect will appear in the distance (relative to the camera). At 1.0 the fog will fully obscure the scene, at 0.0 the fog will not be visible.
float fog_depth_begin = 10.0 🔗
The fog's depth starting distance from the camera. Only available when fog_mode is set to FOG_MODE_DEPTH.
The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Only available when fog_mode is set to FOG_MODE_DEPTH.
The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's Camera3D.far value. Only available when fog_mode is set to FOG_MODE_DEPTH.
如果為 true,則啟用霧效果。
高度霧效果開始的高度。
float fog_height_density = 0.0 🔗
用於隨著高度降低而增加霧的密度。要使霧隨著高度增加而增加,請使用負值。
Color fog_light_color = Color(0.518, 0.553, 0.608, 1) 🔗
霧的顏色。
float fog_light_energy = 1.0 🔗
霧的亮度。值越高,霧越亮。
The fog mode.
非體積霧影響天空時使用的係數。1.0 表示霧可以完全遮蔽天空。較低的值會減少霧對天空算繪的影響,0.0 完全不影響天空的算繪。
注意:如果 fog_aerial_perspective 為 1.0,fog_sky_affect 不會有視覺效果。
如果設定為 0.0 以上,則根據視角以霧色算繪場景的定向光。這可以用來給人一種太陽正在“穿透”霧的印象。
GlowBlendMode glow_blend_mode = 1 🔗
void set_glow_blend_mode(value: GlowBlendMode)
GlowBlendMode get_glow_blend_mode()
The glow blending mode.
Note: The Compatibility renderer always uses GLOW_BLEND_MODE_SCREEN and glow_blend_mode will have no effect.
泛光的強度。如果設定為大於 0 的值,則將在比 glow_hdr_threshold 成員更暗的區域中顯示輝光。
If true, the glow effect is enabled. This simulates real world atmosphere and eye/camera behavior by causing bright pixels to bleed onto surrounding pixels.
Note: When using the Mobile rendering method, glow looks different due to the lower dynamic range available in the Mobile rendering method.
Note: When using the Compatibility rendering method, glow uses a different implementation with some properties being unavailable and hidden from the inspector: glow_levels/*, glow_normalized, glow_strength, glow_blend_mode, glow_mix, glow_map, and glow_map_strength. This implementation is optimized to run on low-end devices and is less flexible as a result.
float glow_hdr_luminance_cap = 12.0 🔗
HDR 輝光的較高閾值。比這個閾值更亮的區域將被限制,以達到輝光效果的目的。
Smooths the transition between values that are below and above glow_hdr_threshold by reducing the amount of glow generated by values that are close to glow_hdr_threshold. Values above glow_hdr_threshold + glow_hdr_scale will not have glow reduced in this way.
float glow_hdr_threshold = 1.0 🔗
HDR 輝光的下限閾值。當使用 Mobile 算繪方法時(僅支援較低的動態範圍,最大為 2.0),需要低於 1.0 才能看到輝光。在這種情況下取 0.9 可以達到不錯的效果。在 2D 中使用輝光時也需要降低到 1.0 以下,因為 2D 算繪使用 SDR。
The overall brightness multiplier that is applied to the glow effect just before it is blended with the scene. When using the Mobile rendering method (which only supports a lower dynamic range up to 2.0), this should be increased to 1.5 to compensate.
The intensity of the 1st level of glow. This is the most "local" level (least blurry).
Note: glow_levels/1 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 2nd level of glow.
Note: glow_levels/2 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 3rd level of glow.
Note: glow_levels/3 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 4th level of glow.
Note: glow_levels/4 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 5th level of glow.
Note: glow_levels/5 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 6th level of glow.
Note: glow_levels/6 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The intensity of the 7th level of glow. This is the most "global" level (blurriest).
Note: glow_levels/7 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The texture that should be used as a glow map to multiply the resulting glow color according to glow_map_strength. This can be used to create a "lens dirt" effect. The texture's RGB color channels are used for modulation, but the alpha channel is ignored.
Note: The texture will be stretched to fit the screen. Therefore, it's recommended to use a texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9).
Note: glow_map has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
float glow_map_strength = 0.8 🔗
How strong of an influence the glow_map should have on the overall glow effect. A strength of 0.0 means the glow map has no influence, while a strength of 1.0 means the glow map has full influence.
Note: If the glow map has black areas, a value of 1.0 can also turn off the glow effect entirely in specific areas of the screen.
Note: glow_map_strength has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
When using the GLOW_BLEND_MODE_MIX glow_blend_mode, this controls how much the source image is blended with the glow layer. A value of 0.0 makes the glow rendering invisible, while a value of 1.0 is equivalent to GLOW_BLEND_MODE_REPLACE.
Note: glow_mix has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
bool glow_normalized = false 🔗
If true, glow levels will be normalized so that summed together their intensities equal 1.0.
Note: glow_normalized has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
The strength that is used when blurring across the screen to generate the glow effect. This affects the distance and intensity of the blur. When using the Mobile rendering method, this should be increased to compensate for the lower dynamic range.
Note: glow_strength has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.
ReflectionSource reflected_light_source = 0 🔗
void set_reflection_source(value: ReflectionSource)
ReflectionSource get_reflection_source()
反射(鏡面反射)光源。
float sdfgi_bounce_feedback = 0.5 🔗
使用 SDFGI 時,每次從表面反彈時套用於光的能量倍增器。大於 0.0 的值將模擬多次反彈,從而產生更逼真的外觀。增加 sdfgi_bounce_feedback 通常對性能沒有影響。另見 sdfgi_energy。
注意:大於 0.5 的值會導致無限的回饋迴圈,應避免在具有明亮材質的場景中使用。
注意:如果 sdfgi_bounce_feedback 為 0.0,間接照明會在反射中表現出來,因為光只會反彈一次。
float sdfgi_cascade0_distance = 12.8 🔗
注意:該屬性被連結到 sdfgi_min_cell_size 和 sdfgi_max_distance。更改其值也會自動更改這些屬性。
用於 SDFGI 的級聯數(1 到 8 之間)。更高的級聯數會以性能為代價,允許在更遠的地方顯示 SDFGI,同時保持近距離的細節。在小型關卡上使用 SDFGI 時,通常 sdfgi_cascades 可以被降低到 1 和 4 之間以提高性能。
如果為 true,則為將 GeometryInstance3D.gi_mode 設定為 GeometryInstance3D.GI_MODE_STATIC 的網格,啟用有符號距離場全域照明(即 SDFGI)。SDFGI 是一種即時全域照明技術,適用於程式生成和使用者建構的關卡,包括在遊戲過程中建立幾何體的情況。有符號距離場會在相機移動時自動圍繞相機生成。支援動態光,但不支援動態遮擋物和自發光表面。
注意:SDFGI 只支援 Forward+ 算繪方式,不支援 Mobile 或 Compatibility。
性能:SDFGI 對 GPU 的要求比較高,不適合集成顯卡等低端硬體(可以考慮 LightmapGI)。要提高 SDFGI 性能,請在專案設定中啟用 ProjectSettings.rendering/global_illumination/gi/use_half_resolution。
注意:網格應該有足夠厚的壁以避免漏光(避免單面壁)。對於內部關卡,將關卡幾何體放入一個足夠大的盒子中,並橋接迴圈邊以閉合網格。
用於 SDFGI 的能量乘數。較高的值將導致更亮的間接照明和反射。另見 sdfgi_bounce_feedback。
float sdfgi_max_distance = 204.8 🔗
SDFGI 可見的最大距離。超出該距離,環境照明或其他 GI 來源(例如 ReflectionProbe)將用作後備。
注意:該屬性被連結到 sdfgi_min_cell_size 和 sdfgi_cascade0_distance。更改其值,也會自動更改這些屬性。
float sdfgi_min_cell_size = 0.2 🔗
用於最接近的 SDFGI 級聯的像元大小(以 3D 單位表示)。較低的值允許 SDFGI 近距離更精確,但代價是 SDFGI 更新要求更高。當相機快速移動時,這可能會導致卡頓。較高的值允許 SDFGI 覆蓋更多的範圍,同時也降低了 SDFGI 更新對性能的影響。
注意:該屬性被連結到 sdfgi_max_distance 和 sdfgi_cascade0_distance。更改其值也會自動更改這些屬性。
float sdfgi_normal_bias = 1.1 🔗
用於 SDFGI 探查的正常偏差。增加此值可以減少傾斜表面上的可見條紋偽影,但會增加漏光。
float sdfgi_probe_bias = 1.1 🔗
用於 SDFGI 探查的恒定偏差。增加此值可以減少傾斜表面上的可見條紋偽影,但會增加漏光。
bool sdfgi_read_sky_light = true 🔗
如果為 true,則 SDFGI 會考慮環境光照。對於室內場景,這應該被設定為 false。
bool sdfgi_use_occlusion = false 🔗
如果為 true,SDFGI 使用遮擋偵測方法來減少漏光。然而,遮擋可能會在某些位置引入暗斑,這在大多數戶外場景中可能是不希望的。sdfgi_use_occlusion 對性能有影響,只應在需要時啟用。
SDFGIYScale sdfgi_y_scale = 1 🔗
void set_sdfgi_y_scale(value: SDFGIYScale)
SDFGIYScale get_sdfgi_y_scale()
用於 SDFGI 儲存格的 Y 縮放。較低的值將導致 SDFGI 儲存格在 Y 軸上更緊密地堆積在一起。這用於在品質和覆蓋大量垂直地面之間取得平衡。sdfgi_y_scale 應該根據場景的垂直程度(以及相機在 Y 軸上移動的速度)來設定。
該 Environment 所使用的 Sky 資源。
如果被設定為大於 0.0 的值,則會覆蓋用於天空算繪的視野。如果被設置為 0.0,則使用與目前 Camera3D 相同的 FOV 進行天空算繪。
Vector3 sky_rotation = Vector3(0, 0, 0) 🔗
用於天空算繪的旋轉。
float ssao_ao_channel_affect = 0.0 🔗
定義了AO紋理的材質的螢幕空間環境遮擋強度。高於0的值將使SSAO效果在AO紋理變暗的區域可見。
設定螢幕空間環境遮蔽效果的附加細節級別的強度。高的值會使細節傳遞更加突出,但它可能會導致最終圖像中出現鋸齒。
If true, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion.
Note: SSAO is only supported in the Forward+ and Compatibility rendering methods, not Mobile.
用於考慮表面上給定點是否被遮擋的閾值,表示為與地平線的角度,對應到 0.0-1.0 範圍。1.0 的值不會導致遮蔽。
主要螢幕空間的環境光遮蔽強度。用作螢幕空間環境光遮蔽效果的乘數。較高的值會導致較暗的遮蔽。
float ssao_light_affect = 0.0 🔗
直射光下的螢幕空間環境光遮蔽強度。在現實生活中,環境遮擋只適用於間接光,也就是說在直射光下無法看到其效果。高於0的數值將使SSAO效果在直射光下可見。
光遮蔽的分佈。更高的值會導致更暗的光遮蔽,類似於 ssao_intensity,但衰減更劇烈。
計算螢幕空間環境光遮蔽時,物件可以相互遮蔽的距離。較高的值將導致以性能和品質為代價的更遠距離的光遮蔽。
允許螢幕空間環境光遮蔽效果,在物件邊緣上模糊的量。設定太高,會導致對象邊緣出現鋸齒。設定太低,會使對象邊緣顯得模糊。
如果為 true,則啟用螢幕空間間接照明效果。螢幕空間間接照明是一種間接照明形式,它允許漫射光在附近的物體之間反射。螢幕空間間接照明與螢幕空間環境光遮蔽的工作方式非常相似,因為它只影響有限的範圍。它旨在與 SDFGI 或 VoxelGI 等適當的全域照明形式一起使用。螢幕空間間接光照不受單個光源 Light3D.light_indirect_energy 的影響。
注意:SSIL 只支援 Forward+ 算繪方式,不支援 Mobile 或 Compatibility。
螢幕空間間接照明效果的亮度倍增器。更高的值會產生更亮的光。
float ssil_normal_rejection = 1.0 🔗
計算螢幕空間間接照明時,使用的法線拋棄量。法線拋棄使用給定樣本點的法線,來拋棄遠離目前圖元的樣本。當只有物體的一側被照亮時,為了避免漏光法線拋棄是必要的。但是,如果需要漏光,則可以禁用法線拋棄,例如當場景主要包含自發光對象,且其發光面從相機無法看到時。
使用螢幕空間間接照明效果時,反射光可以傳播的距離。較大的值,會導致光線在場景中進一步反彈,但可能會導致取樣不足的偽影,看起來像光源周圍的長尖峰。
允許螢幕空間間接照明效果,在物件邊緣上模糊的量。設定太高,會導致物件邊緣出現鋸齒。設定太低,會使對象邊緣顯得模糊。
float ssr_depth_tolerance = 0.5 🔗
螢幕空間反射的深度公差。
如果 true,則啟用螢幕空間反射。螢幕空間反射比體素全域光照 (VoxelGI) 或反射探針 (ReflectionProbe) 的反射更精確,但速度較慢,且無法反射被其他物體遮蔽的表面。
注意: 螢幕空間反射僅在 Forward+ 渲染模式下受支持,不支援行動端或相容模式。
注意: 螢幕空間反射不支援具有透明背景的視窗(Viewport.transparent_bg 為 true)。
螢幕空間反射的淡入距離。影響從反射材質到螢幕空間反射的區域。只有正值有效(負值將被鉗制為 0.0)。
螢幕空間反射的淡出距離。影響從螢幕空間反射到“全域”反射的區域。只有正值有效(負值將被鉗制為 0.0)。
螢幕空間反射的最大步數。數值越高,速度越慢。
float tonemap_agx_contrast = 1.25 🔗
Increasing tonemap_agx_contrast will make dark values darker and bright values brighter. Produces a higher quality result than adjustment_contrast without any additional performance cost, but is only available when using the TONE_MAPPER_AGX tonemapper.
float tonemap_agx_white = 16.29 🔗
The white reference value for tonemapping, which indicates where bright white is located in the scale of values provided to the tonemapper. For photorealistic lighting, it is recommended to set tonemap_agx_white to at least 6.0. Higher values result in less blown out highlights, but may make the scene appear lower contrast. tonemap_agx_white is the same as tonemap_white, but is only effective with the TONE_MAPPER_AGX tonemapper. See also tonemap_exposure.
Note: When using the Mobile renderer with Viewport.use_hdr_2d disabled, tonemap_agx_white is ignored and a white value of 2.0 will always be used instead. Otherwise, tonemap_agx_white will be dynamically adjusted at runtime by multiplying it by the parent window's Window.get_output_max_linear_value() when using Viewport.use_hdr_2d to ensure good behavior with both SDR and HDR output.
float tonemap_exposure = 1.0 🔗
Adjusts the brightness of values before they are provided to the tonemapper. Higher tonemap_exposure values result in a brighter image. See also tonemap_white.
Note: Values provided to the tonemapper will also be multiplied by 2.0 and 1.8 for TONE_MAPPER_FILMIC and TONE_MAPPER_ACES respectively to produce a similar apparent brightness as TONE_MAPPER_LINEAR.
ToneMapper tonemap_mode = 0 🔗
void set_tonemapper(value: ToneMapper)
ToneMapper get_tonemapper()
The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on an LDR display. (Godot doesn't support rendering on HDR displays yet.)
The white reference value for tonemapping, which indicates where bright white is located in the scale of values provided to the tonemapper. For photorealistic lighting, it is recommended to set tonemap_white to at least 6.0. Higher values result in less blown out highlights, but may make the scene appear lower contrast. tonemap_agx_white will be used instead when using the TONE_MAPPER_AGX tonemapper. See also tonemap_exposure.
Note: tonemap_white must be set to 2.0 or lower on the Mobile renderer to produce bright images.
Note: tonemap_white is ignored when using TONE_MAPPER_LINEAR and will be dynamically adjusted at runtime to never be less than the parent window's Window.get_output_max_linear_value() when using TONE_MAPPER_REINHARDT with Viewport.use_hdr_2d.
Color volumetric_fog_albedo = Color(1, 1, 1, 1) 🔗
與燈光互動時體積霧的 Color。當煙霧的反照率顏色更暗時,薄霧和霧的反照率顏色接近 Color(1, 1, 1, 1)。
float volumetric_fog_ambient_inject = 0.0 🔗
衡量體積霧中使用的環境光的強度。值為 0.0 ,意味著環境光不會影響體積霧。當 volumetric_fog_ambient_inject 設定高於 0.0 時,會有一個小的性能成本。
注意:如果 volumetric_fog_density 為 0.0,或 volumetric_fog_albedo 是全黑的顏色,則該屬性沒有可見效果。
float volumetric_fog_anisotropy = 0.2 🔗
散射光穿過體積霧時的方向。接近 1.0 的值意味著幾乎所有的光都是向前散射的。接近 0.0 的值表示光在所有方向上均勻散射。接近 -1.0 的值表示光主要向後散射。霧和薄霧會稍微向前散射光,而煙霧則向各個方向均勻散射光。
float volumetric_fog_density = 0.05 🔗
體積霧的基本指數密度。將其設定為希望全域擁有的最低密度。FogVolume 可用於增加或減少特定區域的密度。霧算繪如同在現實生活中一樣是指數式的。
0.0 的值會禁用全域體積霧,同時允許 FogVolume 在特定區域顯示體積霧。
要使體積霧作為一種體積照明解決方案,請將 volumetric_fog_density 設定為最低的非零值(0.0001),然後將燈光的 Light3D.light_volumetric_fog_energy 增加到 10000 和 100000 之間的值,以補償極低的密度。
float volumetric_fog_detail_spread = 2.0 🔗
視錐體素緩衝區長度的大小分佈。較高的值會壓縮更靠近相機的視錐體素,並將更多細節放置在更靠近相機的位置。
Color volumetric_fog_emission = Color(0, 0, 0, 1) 🔗
從體積霧發出的光。即使有自發光,體積霧也不會將光投射到其他表面上。自發光對於建立環境顏色很有用。由於體積霧效果僅使用單次散射,因此霧往往需要一點點自發光來柔化刺眼的陰影。
float volumetric_fog_emission_energy = 1.0 🔗
從體積霧發出的光的亮度。
bool volumetric_fog_enabled = false 🔗
啟用體積霧效果。體積霧使用與螢幕對齊的視錐體素緩衝區,來計算短至中等範圍內的精確體積散射。體積霧與 FogVolume 和燈光互動,以計算局部和全域的霧。體積霧使用一個基於消光、散射、和自發光的 PBR 單一散射模型,它以密度、反照率、和自發光的形式暴露給使用者。
注意:體積霧只支援 Forward+ 算繪方式,不支援移動和相容模式。
float volumetric_fog_gi_inject = 1.0 🔗
衡量體積霧的反照率顏色中使用的全域照明的強度。值為0.0 ,意味著全局照明不會影響體積霧。當 volumetric_fog_gi_inject 設定高於0.0 時,會有很小的性能成本。
注意:如果 volumetric_fog_density 為 0.0,或 volumetric_fog_albedo 是全黑的顏色,則該選項沒有可見效果。
注意:在使用 volumetric_fog_gi_inject 時,只有 VoxelGI 和 SDFGI(sdfgi_enabled)會被考慮到。來自 LightmapGI、ReflectionProbe 和 SSIL(參見 ssil_enabled)的全域照明將被體積霧所忽略。
float volumetric_fog_length = 64.0 🔗
計算體積霧的距離。增加以在更大範圍內計算霧,減少以在不需要長範圍時新增更多細節。為了獲得最佳品質的霧,請將其保持在盡可能低的水平。另請參閱 ProjectSettings.rendering/environment/volumetric_fog/volume_depth。
float volumetric_fog_sky_affect = 1.0 🔗
使用體積霧影響天空時使用的係數。1.0表示體積霧可以完全遮蔽天空。較低的值會減少體積霧對天空算繪的影響,0.0 根本不會影響天空的算繪。
注意:即使 volumetric_fog_density 為 0.0,volumetric_fog_sky_affect 也會影響 FogVolume。如果發現 FogVolume 在仰望天空時正在消失,請將 volumetric_fog_sky_affect 設置為 1.0。
float volumetric_fog_temporal_reprojection_amount = 0.9 🔗
void set_volumetric_fog_temporal_reprojection_amount(value: float)
float get_volumetric_fog_temporal_reprojection_amount()
將最後一影格與目前影格混合的量。更高的數值會導致體積霧更平滑,但會使“重影”變得更糟。更低的值會減少重影,但會導致每影格時間抖動變得可見。
bool volumetric_fog_temporal_reprojection_enabled = true 🔗
void set_volumetric_fog_temporal_reprojection_enabled(value: bool)
bool is_volumetric_fog_temporal_reprojection_enabled()
在體積霧中啟用時間重投影。時間重投影將目前影格的體積霧與上一影格的體積霧混合,以平滑鋸齒狀的邊緣。性能成本最小;但是,它會導致移動 FogVolume 和 Light3D 時“重影”,並在它們身後留下痕跡。啟用時間重投影時,儘量避免將 FogVolume 或 Light3D 移動得太快。短暫的動態光照效果應將 Light3D.light_volumetric_fog_energy 設定為 0.0 以避免重影。
方法說明
float get_glow_level(idx: int) const 🔗
返回輝光級別 idx 的強度。
void set_glow_level(idx: int, intensity: float) 🔗
設定輝光級別 idx 的強度。大於 0.0 時啟用該級別。每個級別都依賴於前一個級別。這意味著啟用較高的輝光等級會減慢輝光效果的算繪速度,即使之前的等級沒有啟用。