Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

CameraAttributesPractical

继承: CameraAttributes < Resource < RefCounted < Object

相机设置,格式比较易用。

描述

控制相机的特定属性,如自动曝光、景深、以及曝光覆盖。

当在 WorldEnvironment 中使用时,它提供了曝光、自动曝光、以及景深的默认设置,这些设置将由所有没有自己的 CameraAttributes 的相机使用,包括编辑器相机。当在 Camera3D 中使用时,它将覆盖 WorldEnvironment 中设置的任何 CameraAttributes。当在 VoxelGILightmapGI 中使用时,只会使用曝光设置。

属性

float

auto_exposure_max_sensitivity

800.0

float

auto_exposure_min_sensitivity

0.0

float

dof_blur_amount

0.1

float

dof_blur_far_distance

10.0

bool

dof_blur_far_enabled

false

float

dof_blur_far_transition

5.0

float

dof_blur_near_distance

2.0

bool

dof_blur_near_enabled

false

float

dof_blur_near_transition

1.0


属性说明

float auto_exposure_max_sensitivity = 800.0

  • void set_auto_exposure_max_sensitivity ( float value )

  • float get_auto_exposure_max_sensitivity ( )

计算自动曝光时使用的最大感光度(单位:ISO)。在计算场景平均亮度时,颜色值将至少被钳制在这个值上。这限制了自动曝光在低于一定的亮度进行曝光时,导致场景将保持明亮的一个截止点。


float auto_exposure_min_sensitivity = 0.0

  • void set_auto_exposure_min_sensitivity ( float value )

  • float get_auto_exposure_min_sensitivity ( )

计算自动曝光时使用的最小感光度(单位:ISO)。在计算场景平均亮度时,颜色值将至少被钳制在这个值上。这限制了自动曝光在超过一定的亮度进行曝光时,导致场景将保持黑暗的一个截止点。


float dof_blur_amount = 0.1

  • void set_dof_blur_amount ( float value )

  • float get_dof_blur_amount ( )

设置最大模糊量。当使用基于物理的模糊量时,将改为充当一个乘数。高值会导致模糊度增加,但计算起来会更昂贵。对于一个给定的艺术风格,最好将该值保持得尽可能低。


float dof_blur_far_distance = 10.0

  • void set_dof_blur_far_distance ( float value )

  • float get_dof_blur_far_distance ( )

距离该 Camera3D 比该值远的对象将因景深效果而变得模糊。以米为单位进行测量。


bool dof_blur_far_enabled = false

  • void set_dof_blur_far_enabled ( bool value )

  • bool is_dof_blur_far_enabled ( )

为比 dof_blur_far_distance 更远的对象启用景深模糊。模糊强度由 dof_blur_amount 控制并由 dof_blur_far_transition 调制。

注意:景深模糊只支持 Forward+ 和移动渲染方式,不支持兼容模式。


float dof_blur_far_transition = 5.0

  • void set_dof_blur_far_transition ( float value )

  • float get_dof_blur_far_transition ( )

当为正数时,距离超过该值(从 dof_blur_far_distance 开始)时,模糊效果将从 0 缩放到 dof_blur_amount。当为负数时,使用基于物理的缩放,因此景深效果将在 dof_blur_far_distance 处从 0 开始缩放,并且随着对象远离该 Camera3D,将以物理上准确的方式增加该效果。


float dof_blur_near_distance = 2.0

  • void set_dof_blur_near_distance ( float value )

  • float get_dof_blur_near_distance ( )

距离该 Camera3D 比该值近的对象将因景深效果而变得模糊。以米为单位进行测量。


bool dof_blur_near_enabled = false

  • void set_dof_blur_near_enabled ( bool value )

  • bool is_dof_blur_near_enabled ( )

为比 dof_blur_near_distance 更近的对象启用景深模糊。模糊强度由 dof_blur_amount 控制并由 dof_blur_near_transition 调制。

注意:景深模糊只支持 Forward+ 和移动渲染方式,不支持兼容模式。


float dof_blur_near_transition = 1.0

  • void set_dof_blur_near_transition ( float value )

  • float get_dof_blur_near_transition ( )

当为正数时,距离超过该值且截止到 dof_blur_near_distance 时,模糊效果将从 0 缩放到 dof_blur_amount。当为负数时,使用基于物理的缩放,因此景深效果将在 dof_blur_near_distance 处从 0 开始缩放,并且随着对象靠近该 Camera3D,将以物理上准确的方式增加该效果。