reckfellENGINE

GltfLight

Represents a glTF light.

On this page
class GltfLightReckfellSharpInherits Resource

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
# GltfLight
C#
public GltfLight();

Properties6

ColorProperty
# Color
C#
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
# InnerConeAngle
C#
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
# Intensity
C#
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
# LightType
C#
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
# OuterConeAngle
C#
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
# Range
C#
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
# FromDictionary
C#
public static GltfLight FromDictionary(Reckfell.Collections.Dictionary dictionary);

Creates a new GLTFLight instance by parsing the given Reckfell.Collections.Dictionary.

Parameters
NameTypeDefault
dictionaryReckfell.Collections.Dictionary—
Returns GltfLight
FromNodeGltfLight
# FromNode
C#
public static GltfLight FromNode(Light3D lightNode);

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

Parameters
NameTypeDefault
lightNodeLight3D—
Returns GltfLight
GetAdditionalDataVariant
# GetAdditionalData
C#
public Variant GetAdditionalData(StringName extensionName);
Parameters
NameTypeDefault
extensionNameStringName—
Returns Variant
GetColorColor
# GetColor
C#
public Color GetColor();
Returns Color
GetInnerConeAnglefloat
# GetInnerConeAngle
C#
public float GetInnerConeAngle();
Returns float
GetIntensityfloat
# GetIntensity
C#
public float GetIntensity();
Returns float
GetLightTypestring
# GetLightType
C#
public string GetLightType();
Returns string
GetOuterConeAnglefloat
# GetOuterConeAngle
C#
public float GetOuterConeAngle();
Returns float
GetRangefloat
# GetRange
C#
public float GetRange();
Returns float
SetAdditionalDatavoid
# SetAdditionalData
C#
public void SetAdditionalData(StringName extensionName, Variant additionalData);
Parameters
NameTypeDefault
extensionNameStringName—
additionalDataVariant—
SetColorvoid
# SetColor
C#
public void SetColor(Color color);
Parameters
NameTypeDefault
colorColor—
SetInnerConeAnglevoid
# SetInnerConeAngle
C#
public void SetInnerConeAngle(float innerConeAngle);
Parameters
NameTypeDefault
innerConeAnglefloat—
SetIntensityvoid
# SetIntensity
C#
public void SetIntensity(float intensity);
Parameters
NameTypeDefault
intensityfloat—
SetLightTypevoid
# SetLightType
C#
public void SetLightType(string lightType);
Parameters
NameTypeDefault
lightTypestring—
SetOuterConeAnglevoid
# SetOuterConeAngle
C#
public void SetOuterConeAngle(float outerConeAngle);
Parameters
NameTypeDefault
outerConeAnglefloat—
SetRangevoid
# SetRange
C#
public void SetRange(float range);
Parameters
NameTypeDefault
rangefloat—
ToDictionaryReckfell.Collections.Dictionary
# ToDictionary
C#
public Reckfell.Collections.Dictionary ToDictionary();

Serializes this GLTFLight instance into a Reckfell.Collections.Dictionary.

Returns Reckfell.Collections.Dictionary
ToNodeLight3D
# ToNode
C#
public Light3D ToNode();

Converts this GLTFLight instance into a Reckfell Light3D node.

Returns Light3D
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.