GLTFLight.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GLTFLight" inherits="Resource" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
  3. <brief_description>
  4. Represents a GLTF light.
  5. </brief_description>
  6. <description>
  7. Represents a light as defined by the [code]KHR_lights_punctual[/code] GLTF extension.
  8. </description>
  9. <tutorials>
  10. <link title="KHR_lights_punctual GLTF extension spec">https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual</link>
  11. </tutorials>
  12. <methods>
  13. <method name="from_dictionary" qualifiers="static">
  14. <return type="GLTFLight" />
  15. <param index="0" name="dictionary" type="Dictionary" />
  16. <description>
  17. Creates a new GLTFLight instance by parsing the given [Dictionary].
  18. </description>
  19. </method>
  20. <method name="from_node" qualifiers="static">
  21. <return type="GLTFLight" />
  22. <param index="0" name="light_node" type="Light3D" />
  23. <description>
  24. Create a new GLTFLight instance from the given Godot [Light3D] node.
  25. </description>
  26. </method>
  27. <method name="to_dictionary" qualifiers="const">
  28. <return type="Dictionary" />
  29. <description>
  30. Serializes this GLTFLight instance into a [Dictionary].
  31. </description>
  32. </method>
  33. <method name="to_node" qualifiers="const">
  34. <return type="Light3D" />
  35. <description>
  36. Converts this GLTFLight instance into a Godot [Light3D] node.
  37. </description>
  38. </method>
  39. </methods>
  40. <members>
  41. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
  42. The [Color] of the light. Defaults to white. A black color causes the light to have no effect.
  43. </member>
  44. <member name="inner_cone_angle" type="float" setter="set_inner_cone_angle" getter="get_inner_cone_angle" default="0.0">
  45. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  46. Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot [SpotLight3D], the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
  47. </member>
  48. <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0">
  49. The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier.
  50. </member>
  51. <member name="light_type" type="String" setter="set_light_type" getter="get_light_type" default="&quot;&quot;">
  52. The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's [OmniLight3D], [SpotLight3D], and [DirectionalLight3D] respectively.
  53. </member>
  54. <member name="outer_cone_angle" type="float" setter="set_outer_cone_angle" getter="get_outer_cone_angle" default="0.785398">
  55. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  56. At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot [SpotLight3D], the outer cone angle is used as the angle of the spotlight.
  57. </member>
  58. <member name="range" type="float" setter="set_range" getter="get_range" default="inf">
  59. 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.
  60. </member>
  61. </members>
  62. </class>