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
Represents a glTF light.
說明
Represents a light as defined by the KHR_lights_punctual glTF extension.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
方法
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) 🔗
The Color of the light in linear space. Defaults to white. A black color causes the light to have no effect.
This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Godot Light3D node upon import, or converted to linear when exporting a Godot Light3D to 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 時,外錐角被用作聚光燈的角度。
The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 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 節點。