光源

*此內容是使用 AI(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

點光源

A 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

表面光

A SurfaceLightBasePart 的臉部發出光。這個對象非常適合從電視或電腦螢幕、廣告牌和螢光板上照明。

表面燈的 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.
陰影 = 已停用