Table of Contents

Class GltfLight

Namespace
Godot
Assembly
GodotSharp.dll

Represents a light as defined by the KHR_lights_punctual GLTF extension.

[GodotClassName("GLTFLight")]
public class GltfLight : Resource, IDisposable
Inheritance
GltfLight
Implements
Inherited Members

Constructors

GltfLight()

public GltfLight()

Properties

Color

The Color of the light. Defaults to white. A black color causes the light to have no effect.

public Color Color { get; set; }

Property Value

Color

InnerConeAngle

The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.

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.

public float InnerConeAngle { get; set; }

Property Value

float

Intensity

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.

public float Intensity { get; set; }

Property Value

float

LightType

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.

public string LightType { get; set; }

Property Value

string

OuterConeAngle

The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.

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.

public float OuterConeAngle { get; set; }

Property Value

float

Range

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.

public float Range { get; set; }

Property Value

float

Methods

FromDictionary(Dictionary)

Creates a new GLTFLight instance by parsing the given Dictionary.

public static GltfLight FromDictionary(Dictionary dictionary)

Parameters

dictionary Dictionary

Returns

GltfLight

FromNode(Light3D)

Create a new GLTFLight instance from the given Godot Light3D node.

public static GltfLight FromNode(Light3D lightNode)

Parameters

lightNode Light3D

Returns

GltfLight

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

ToDictionary()

Serializes this GLTFLight instance into a Dictionary.

public Dictionary ToDictionary()

Returns

Dictionary

ToNode()

Converts this GLTFLight instance into a Godot Light3D node.

public Light3D ToNode()

Returns

Light3D