GLTFLight.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GLTFLight" inherits="Resource" version="3.6" 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. [b]Note:[/b] This class is only compiled in editor builds. Run-time glTF loading and saving is [i]not[/i] available in exported projects. References to [GLTFLight] within a script will cause an error in an exported project.
  9. </description>
  10. <tutorials>
  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="to_dictionary" qualifiers="const">
  15. <return type="Dictionary" />
  16. <description>
  17. Serializes this GLTFLight instance into a [Dictionary].
  18. </description>
  19. </method>
  20. <method name="to_node" qualifiers="const">
  21. <return type="Light" />
  22. <description>
  23. Converts this GLTFLight instance into a Godot [Light] node.
  24. </description>
  25. </method>
  26. </methods>
  27. <members>
  28. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
  29. The [Color] of the light. Defaults to white. A black color causes the light to have no effect.
  30. </member>
  31. <member name="inner_cone_angle" type="float" setter="set_inner_cone_angle" getter="get_inner_cone_angle" default="0.0">
  32. The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
  33. 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 [SpotLight], the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
  34. </member>
  35. <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0">
  36. 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.
  37. </member>
  38. <member name="outer_cone_angle" type="float" setter="set_outer_cone_angle" getter="get_outer_cone_angle" default="0.785398">
  39. The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
  40. 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 [SpotLight], the outer cone angle is used as the angle of the spotlight.
  41. </member>
  42. <member name="range" type="float" setter="set_range" getter="get_range" default="inf">
  43. 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.
  44. </member>
  45. <member name="type" type="String" setter="set_type" getter="get_type" default="&quot;&quot;">
  46. The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's [OmniLight], [SpotLight], and [DirectionalLight] respectively.
  47. </member>
  48. </members>
  49. <constants>
  50. </constants>
  51. </class>