跳转至

DirectionalLight

继承

Light

简要描述

远处的定向光,例如太阳。

描述

定向光源是一种Light节点,可以对覆盖整个场景的无限数量的平行光线进行建模。它用于远离场景的强光照明,以模拟阳光或月光。DirectionalLight的origin位置通常被忽略。仅根据basis来确定光的方向。

成员

类型 属性名 默认值
float directional_shadow_bias_split_scale 0.25
bool directional_shadow_blend_splits false
int directional_shadow_depth_range 0
float directional_shadow_max_distance 100.0
int directional_shadow_mode 2
float directional_shadow_normal_bias 0.8
float directional_shadow_split_1 0.1
float directional_shadow_split_2 0.2
float directional_shadow_split_3 0.5
float shadow_bias 0.1

枚举

enum ShadowMode: - SHADOW_ORTHOGONAL = 0

从正交的角度渲染整个场景的阴影贴图。可能在靠近的物体上产生模糊的阴影。

  • SHADOW_PARALLEL_2_SPLITS = 1

将视锥体分成两个区域,每个区域都有自己的阴影贴图。

  • SHADOW_PARALLEL_4_SPLITS = 2

将视锥体分成4个区域,每个区域都有自己的阴影贴图。


enum ShadowDepthRange: - SHADOW_DEPTH_RANGE_STABLE = 0

当照相机移动时,保持阴影稳定,但以降低有效阴影分辨率为代价。

  • SHADOW_DEPTH_RANGE_OPTIMIZED = 1

尝试获得最大的阴影分辨率。可能会导致阴影边缘出现锯齿效果。


成员说明

  • float directional_shadow_bias_split_scale
Default 0.25
setter set_param(value)
getter get_param
  • bool directional_shadow_blend_splits
Default false
setter set_blend_splits(value)
getter is_blend_splits_enabled
  • int directional_shadow_depth_range
Default 0
setter set_shadow_depth_range(value)
getter get_shadow_depth_range
  • float directional_shadow_max_distance
Default 100.0
setter set_param(value)
getter get_param
  • int directional_shadow_mode
Default 2
setter set_shadow_mode(value)
getter get_shadow_mode
  • float directional_shadow_normal_bias
Default 0.8
setter set_param(value)
getter get_param
  • float directional_shadow_split_1
Default 0.1
setter set_param(value)
getter get_param
  • float directional_shadow_split_2
Default 0.2
setter set_param(value)
getter get_param
  • float directional_shadow_split_3
Default 0.5
setter set_param(value)
getter get_param
  • float shadow_bias
Default 0.1
setter set_param(value)
getter get_param