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...
GLTFLight
繼承: Resource < RefCounted < Object
代表 glTF 燈光。
說明
代表由 KHR_lights_punctual glTF 擴充定義的燈光。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
方法
from_dictionary(dictionary: Dictionary) static |
|
get_additional_data(extension_name: StringName) |
|
void |
set_additional_data(extension_name: StringName, additional_data: Variant) |
to_dictionary() const |
|
to_node() const |
屬性說明
Color color = Color(1, 1, 1, 1) 🔗
燈光線上性空間中的 Color。預設為白色。如果為黑色則燈光不會產生任何效果。
該值為線性,與 glTF 一致,但是匯入建立 Godot Light3D 時會轉換至非線性 sRGB 空間,將 Godot Light3D 匯出為 glTF 時會轉換至線性空間。
float inner_cone_angle = 0.0 🔗
聚光燈下圓錐體的內角。必須小於等於外錐角。
在這個角度內,光線處於全亮狀態。在內錐角和外錐角之間,存在一個從全亮度到零亮度的過渡。建立 Godot SpotLight3D 時,內外錐角之間的比率將被來計算光的衰減。
光的強度。對於點光和聚光,用燭光(流明/立體光)表示;對於平行光,用勒克斯(流明/平方米)表示。在建立 Godot 燈光時,這個值會被轉換為無單位的乘數。
燈光的型別。Godot接受的值有“point”、“spot”、“directional”,分別對應 Godot 的 OmniLight3D、SpotLight3D、DirectionalLight3D。
float outer_cone_angle = 0.7853982 🔗
聚光燈下圓錐體的外角。必須大於等於內錐角。
在這個角度,光線會下降到零亮度。在內錐角和外錐角之間,存在一個從全亮度到零亮度的過渡。如果這個角度是一個半圓,那麼聚光燈會向所有方向發射。建立一個 Godot SpotLight3D 時,外錐角被用作聚光燈的角度。
燈光的範圍,超過這個範圍燈光無效。沒有定義範圍的 glTF 燈光的行為與物理燈光一樣(範圍無限)。建立 Godot 燈光時,範圍限制在 4096.0。
方法說明
GLTFLight from_dictionary(dictionary: Dictionary) static 🔗
通過解析給定的 Dictionary 新建 GLTFLight 實例。
GLTFLight from_node(light_node: Light3D) static 🔗
從給定的 Godot Light3D 節點新建 GLTFLight 實例。
Variant get_additional_data(extension_name: StringName) 🔗
There is currently no description for this method. Please help us by contributing one!
void set_additional_data(extension_name: StringName, additional_data: Variant) 🔗
There is currently no description for this method. Please help us by contributing one!
Dictionary to_dictionary() const 🔗
將這個 GLTFLight 實例序列化為 Dictionary。
將這個 GLTFLight 實例轉換為 Godot Light3D 節點。