光源

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

光源 本地模拟灯、火炬、聚光灯和电视屏幕等物体的真实照明。通过使用不同类型的光源而不仅仅使用通过 Lighting 服务的普通全球照明,你可以创建沉浸式环境,例如网络朋克城市、传统灯节和沉闷的侦探场景。

A far out view of a diner bulding in the middle of a nighttime city. The diner is utilizing several local light sources.

灯光类型

光类型包括点光聚光灯表面灯。每个从 Light 类中共享各种属性,包括 Color , BrightnessShadows

点光源

一个 PointLight 从单个点发出光球。这个对象非常适合像灯泡、火炬和火球这样的非方向性灯光。

点光源的 Range 属性定义了从光源位置到照明半径的径向距离,以点数计算。

A street lamp point light with a small range.

范围 = 8
>

The same street lamp point light with a larger range.

范围 = 12
>

要在 Studio 中创建一个 PointLight

  1. 探索器 窗口中,将鼠标悬停在 AttachmentBasePart 上,然后单击 ⊕ 按钮 ( Attachment 建议用于点光源发射)。
  2. 从菜单中插入 PointLight
  3. 调整灯光的Range以及共享属性,例如BrightnessColor

聚光灯

A SpotLight 发出带有球形基地的锥形光。这个对象非常适合像街灯、手电筒和车头灯这样的路灯。

聚光灯的 Face 属性决定哪个面/轴灯发射出的光,如下街灯的发光部分所示:

A street lamp spotlight that emits light from its bottom face.

脸 = 底部
>

A street lamp spotlight that emits light from its left face.

脸 = 左侧
>

聚光灯的 Angle 属性定义了从锥体顶部发射的光角。最大值是 180 ,这会照亮从顶点出发的全半球。

A street lamp spotlight with a 30 degree angle of emission.

角度 = 30
>

The same street lamp spotlight with a 75 degree angle of emission.

角度 = 75
>

要在 Studio 中创建一个 SpotLight

  1. 资源管理器 窗口中,将鼠标悬停在 AttachmentBasePart 上,然后单击 ⊕ 按钮。
  2. 从菜单中插入 SpotLight
  3. 将灯光的 Face 属性设置为指定发射哪个方向的灯光。
  4. 调整灯光的 AngleRange 以及 共享属性 例如 BrightnessColor

表面光

一个 SurfaceLight 从一个 BasePart 的脸上发出光。这个对象非常适合从电视或计算机屏幕、广告牌和荧光板上照明。

表面灯的 Face 属性决定了发射光的 BasePart 面。注意到光从整个表面发出,而不仅仅是表面上的一点。

A sign surface light that emits light from its bottom face.

脸 = 底部
>

A sign surface light that emits light from its right face.

脸 = 右侧
>

表面灯的 Angle 属性定义了零件表面的光发射角度。一个角度为 0 意味着光从表面直接出射,而一个角度为 180 意味着光与表面垂直出射。

A sign surface light with a 0 degree angle of emission.

角度 = 0
>

A sign surface light with a 60 degree angle of emission.

角度 = 60
>

要在 Studio 中创建一个 SurfaceLight

  1. 浏览器 窗口中,将鼠标悬停在 BasePart 上,然后单击 ⊕ 按钮。
  2. 从菜单中插入 SurfaceLight
  3. 将灯光的 Face 属性设置为指定哪个表面发出光。
  4. 调整灯光的 AngleRange 以及 共享属性 例如 BrightnessColor

共享属性

所有光源都从 Light 类中共享各种属性,包括 颜色 , 亮度阴影 .

颜色

Color 属性设置发射的光的 Color3 值。

A torch that emits red light.

颜色 = [255, 100, 50]
>

A torch that emits green light.

颜色 = [0, 255, 125]
>

A torch that emits blue light.

颜色 = [75, 150, 255]
>

亮度

Brightness 属性设置光的亮度以最大效果在光的中心。请注意,Brightness 仍然受到定义范围的限制,因此更高的Brightness值不会点亮光周围的更大区域。

A torch that emits low light.

亮度 = 2
>

A torch that emits medium light.

亮度 = 10
>

A torch that emits bright light.

亮度 = 50
>

阴影

Shadows 属性项目投射出遮蔽光线的阴影,当光被障碍物阻挡时。

A corner view of the diner with shadows enabled.

阴影 = 启用
>

A corner view of the diner with shadows disabled.

阴影 = 禁用
>