GLTFLight.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GLTFLight" inherits="Resource" 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="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>
  11. <link title="KHR_lights_punctual glTF extension spec">https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual</link>
  12. </tutorials>
  13. <methods>
  14. <method name="from_dictionary" qualifiers="static">
  15. <return type="GLTFLight" />
  16. <param index="0" name="dictionary" type="Dictionary" />
  17. <description>
  18. Creates a new GLTFLight instance by parsing the given [Dictionary].
  19. </description>
  20. </method>
  21. <method name="from_node" qualifiers="static">
  22. <return type="GLTFLight" />
  23. <param index="0" name="light_node" type="Light3D" />
  24. <description>
  25. Create a new GLTFLight instance from the given Godot [Light3D] node.
  26. </description>
  27. </method>
  28. <method name="get_additional_data">
  29. <return type="Variant" />
  30. <param index="0" name="extension_name" type="StringName" />
  31. <description>
  32. </description>
  33. </method>
  34. <method name="set_additional_data">
  35. <return type="void" />
  36. <param index="0" name="extension_name" type="StringName" />
  37. <param index="1" name="additional_data" type="Variant" />
  38. <description>
  39. </description>
  40. </method>
  41. <method name="to_dictionary" qualifiers="const">
  42. <return type="Dictionary" />
  43. <description>
  44. Serializes this GLTFLight instance into a [Dictionary].
  45. </description>
  46. </method>
  47. <method name="to_node" qualifiers="const">
  48. <return type="Light3D" />
  49. <description>
  50. Converts this GLTFLight instance into a Godot [Light3D] node.
  51. </description>
  52. </method>
  53. </methods>
  54. <members>
  55. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)" keywords="colour">
  56. The [Color] of the light. Defaults to white. A black color causes the light to have no effect.
  57. </member>
  58. <member name="inner_cone_angle" type="float" setter="set_inner_cone_angle" getter="get_inner_cone_angle" default="0.0">
  59. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  60. 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.
  61. </member>
  62. <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0">
  63. 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.
  64. </member>
  65. <member name="light_type" type="String" setter="set_light_type" getter="get_light_type" default="&quot;&quot;">
  66. 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.
  67. </member>
  68. <member name="outer_cone_angle" type="float" setter="set_outer_cone_angle" getter="get_outer_cone_angle" default="0.785398">
  69. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  70. 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.
  71. </member>
  72. <member name="range" type="float" setter="set_range" getter="get_range" default="inf">
  73. 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.
  74. </member>
  75. </members>
  76. </class>