GltfLight
Represents a glTF light.
Represents a glTF light.
Represents a light as defined by the KHR_lights_punctual glTF extension.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
GltfLightConstructor
public GltfLight();Properties6
ColorProperty
public Color Color { get; set; }The Color of the light in linear space. Defaults to white. A black color causes the light to have no effect.
This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Reckfell Light3D node upon import, or converted to linear when exporting a Reckfell Light3D to glTF.
InnerConeAngleProperty
public float InnerConeAngle { get; set; }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 Reckfell SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
IntensityProperty
public float Intensity { get; set; }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 Reckfell light, this value is converted to a unitless multiplier.
LightTypeProperty
public string LightType { get; set; }The type of the light. The values accepted by Reckfell are "point", "spot", and "directional", which correspond to Reckfell's OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.
OuterConeAngleProperty
public float OuterConeAngle { get; set; }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 Reckfell SpotLight3D, the outer cone angle is used as the angle of the spotlight.
RangeProperty
public float Range { get; set; }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 Reckfell light, the range is clamped to 4096.0.
Methods18
FromDictionaryGltfLight
public static GltfLight FromDictionary(Reckfell.Collections.Dictionary dictionary);Creates a new GLTFLight instance by parsing the given Reckfell.Collections.Dictionary.
| Name | Type | Default |
|---|---|---|
dictionary | Reckfell.Collections.Dictionary | — |
GltfLightFromNodeGltfLight
public static GltfLight FromNode(Light3D lightNode);Create a new GLTFLight instance from the given Reckfell Light3D node.
| Name | Type | Default |
|---|---|---|
lightNode | Light3D | — |
GltfLightGetAdditionalDataVariant
public Variant GetAdditionalData(StringName extensionName);| Name | Type | Default |
|---|---|---|
extensionName | StringName | — |
VariantGetColorColor
public Color GetColor();ColorGetInnerConeAnglefloat
public float GetInnerConeAngle();floatGetIntensityfloat
public float GetIntensity();floatGetLightTypestring
public string GetLightType();stringGetOuterConeAnglefloat
public float GetOuterConeAngle();floatGetRangefloat
public float GetRange();floatSetAdditionalDatavoid
public void SetAdditionalData(StringName extensionName, Variant additionalData);| Name | Type | Default |
|---|---|---|
extensionName | StringName | — |
additionalData | Variant | — |
SetColorvoid
public void SetColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetInnerConeAnglevoid
public void SetInnerConeAngle(float innerConeAngle);| Name | Type | Default |
|---|---|---|
innerConeAngle | float | — |
SetIntensityvoid
public void SetIntensity(float intensity);| Name | Type | Default |
|---|---|---|
intensity | float | — |
SetLightTypevoid
public void SetLightType(string lightType);| Name | Type | Default |
|---|---|---|
lightType | string | — |
SetOuterConeAnglevoid
public void SetOuterConeAngle(float outerConeAngle);| Name | Type | Default |
|---|---|---|
outerConeAngle | float | — |
SetRangevoid
public void SetRange(float range);| Name | Type | Default |
|---|---|---|
range | float | — |
ToDictionaryReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary ToDictionary();Serializes this GLTFLight instance into a Reckfell.Collections.Dictionary.
Reckfell.Collections.Dictionary