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 节点。