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...
DirectionalLight2D
继承: Light2D < Node2D < CanvasItem < Node < Object
来自远处的 2D 平行光。
描述
平行光是一种 Light2D 节点,模拟覆盖整个场景的无数平行光线。可用于远离场景的强光(例如:模拟日光或月光)。
注意:DirectionalLight2D 不支持灯光剔除遮罩(但支持阴影剔除遮罩)。它会忽略 2D 节点的 CanvasItem.light_mask,始终点亮 2D 节点。
教程
属性
|
||
|
属性说明
灯光的高度。用于 2D 法线贴图。范围从 0(平行于平面)到 1(垂直于平面)。
float max_distance = 10000.0
🔗
对象在其阴影被剔除前与相机中心的最大距离(单位:像素)。降低这个值可以防止位于相机外部的对象投射阴影(同时还可以提高性能)。Camera2D.zoom 不被 max_distance 考虑在内,这意味着在较高的缩放值下,当缩放到一个给定的点时,阴影会更快地淡出。