CameraAttributesPhysical

繼承: CameraAttributes < Resource < RefCounted < Object

基於物理的相機設定。

說明

CameraAttributesPhysical 用於根據基於物理的相機的設定來設定算繪設定。它負責曝光、自動曝光、以及景深。

當在 WorldEnvironment 中使用時,它提供了曝光、自動曝光、以及景深的預設設置,這些設定將由所有沒有自己的 CameraAttributes 的相機使用,包括編輯器相機。當在 Camera3D 中使用時,它將覆蓋 WorldEnvironment 中設定的任何 CameraAttributes,並將覆蓋 Camera3DCamera3D.farCamera3D.nearCamera3D.fov、以及 Camera3D.keep_aspect 屬性。當在 VoxelGILightmapGI 中使用時,將只會使用曝光設定。

預設設定適用於室外環境,可在每個設定的文件中找到有關在室內環境中使用的設定的提示。

注意:景深模糊只支援 Forward+ 和移動算繪方式,不支援相容模式。

教學

屬性

float

auto_exposure_max_exposure_value

10.0

float

auto_exposure_min_exposure_value

-8.0

float

exposure_aperture

16.0

float

exposure_shutter_speed

100.0

float

frustum_far

4000.0

float

frustum_focal_length

35.0

float

frustum_focus_distance

10.0

float

frustum_near

0.05

方法

float

get_fov() const


屬性說明

float auto_exposure_max_exposure_value = 10.0 🔗

  • void set_auto_exposure_max_exposure_value(value: float)

  • float get_auto_exposure_max_exposure_value()

計算自動曝光時使用的最大亮度(單位:EV100)。在計算場景平均亮度時,顏色值將至少被鉗制在這個值上。這限制了自動曝光在低於一定的亮度進行曝光時,導致場景將保持明亮的一個截止點。


float auto_exposure_min_exposure_value = -8.0 🔗

  • void set_auto_exposure_min_exposure_value(value: float)

  • float get_auto_exposure_min_exposure_value()

The minimum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark.


float exposure_aperture = 16.0 🔗

  • void set_aperture(value: float)

  • float get_aperture()

相機光圈的大小,以 f 檔為單位進行測量。f 檔是相機焦距與光圈直徑之間的一個無單位比率。高光圈設定將產生一個更小的光圈,從而導致更暗的圖像和更清晰的焦點。低光圈會產生一個大光圈,讓更多的光線進入,從而產生一個更亮、更不聚焦的圖像。默認值適用於白天的室外(即與預設 DirectionalLight3D 一起使用),對於室內照明,2 到 4 之間的值更合適。

僅在啟用 ProjectSettings.rendering/lights_and_shadows/use_physical_light_units 時可用。


float exposure_shutter_speed = 100.0 🔗

  • void set_shutter_speed(value: float)

  • float get_shutter_speed()

Time for shutter to open and close, evaluated as 1 / shutter_speed seconds. A higher value will allow less light (leading to a darker image), while a lower value will allow more light (leading to a brighter image).

Only available when ProjectSettings.rendering/lights_and_shadows/use_physical_light_units is enabled.


float frustum_far = 4000.0 🔗

覆蓋 Camera3D.far 的值。在內部計算景深時使用。當被附加到 Camera3D 作為其 Camera3D.attributes 時,它將覆蓋 Camera3D.fov 屬性。


float frustum_focal_length = 35.0 🔗

  • void set_focal_length(value: float)

  • float get_focal_length()

相機鏡頭和相機光圈之間的距離,單位:毫米。控制視野和景深。較大的焦距會導致較小的視野和較窄的景深,這意味著更少的對象將在焦點中。較小的焦距會導致更寬的視野和更大的景深,這意味著更多的物體將在焦點中。當被附加到 Camera3D 作為其 Camera3D.attributes 時,它將覆蓋 Camera3D.fov 屬性和 Camera3D.keep_aspect 屬性。


float frustum_focus_distance = 10.0 🔗

  • void set_focus_distance(value: float)

  • float get_focus_distance()

將在焦點中的物體與相機的距離,以米為單位進行測量。在內部,這將被鉗制為至少比 frustum_focal_length 大 1 毫米。


float frustum_near = 0.05 🔗

覆蓋 Camera3D.near 的值。在內部計算景深時使用。當被附加到 Camera3D 作為其 Camera3D.attributes 時,它將覆蓋 Camera3D.near 屬性。


方法說明

float get_fov() const 🔗

返回對應於 frustum_focal_length 的垂直視野。每當 frustum_focal_length 發生變化時,該值都會在內部計算。