reckfellENGINE

Light3D

Provides a base class for different kinds of light nodes.

On this page
class Light3DReckfellSharpInherits VisualInstance3D

Provides a base class for different kinds of light nodes.

Light3D is the abstract base class for light nodes. As it can't be instantiated, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties30

DistanceFadeBeginProperty
# DistanceFadeBegin
C#
public float DistanceFadeBegin { get; set; }

The distance from the camera at which the light begins to fade away (in 3D units). Note: Only effective for OmniLight3D and SpotLight3D.

DistanceFadeEnabledProperty
# DistanceFadeEnabled
C#
public bool DistanceFadeEnabled { get; set; }

If true, the light will smoothly fade away when far from the active Camera3D starting at Light3D.DistanceFadeBegin. This acts as a form of level of detail (LOD). The light will fade out over Light3D.DistanceFadeBegin + Light3D.DistanceFadeLength, after which it will be culled and not sent to the shader at all. Use this to reduce the number of active lights in a scene and thus improve performance. Note: Only effective for OmniLight3D and SpotLight3D.

DistanceFadeLengthProperty
# DistanceFadeLength
C#
public float DistanceFadeLength { get; set; }

Distance over which the light and its shadow fades. The light's energy and shadow's opacity is progressively reduced over this distance and is completely invisible at the end. Note: Only effective for OmniLight3D and SpotLight3D.

DistanceFadeShadowProperty
# DistanceFadeShadow
C#
public float DistanceFadeShadow { get; set; }

The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than Light3D.DistanceFadeBegin + Light3D.DistanceFadeLength to further improve performance, as shadow rendering is often more expensive than light rendering itself. Note: Only effective for OmniLight3D and SpotLight3D, and only when Light3D.ShadowEnabled is true.

EditorOnlyProperty
# EditorOnly
C#
public bool EditorOnly { get; set; }

If true, the light only appears in the editor and will not be visible at runtime. If true, the light will never be baked in LightmapGI regardless of its Light3D.LightBakeMode.

LightAngularDistanceProperty
# LightAngularDistance
C#
public float LightAngularDistance { get; set; }

The light's angular size in degrees. Increasing this will make shadows softer at greater distances (also called percentage-closer soft shadows, or PCSS). Only available for DirectionalLight3Ds. For reference, the Sun from the Earth is approximately 0.5. Increasing this value above 0.0 for lights with shadows enabled will have a noticeable performance cost due to PCSS. Note: Light3D.LightAngularDistance is not affected by Entity3D.Scale (the light's scale or its parent's scale). Note: PCSS for directional lights is only supported in the Forward+ rendering method, not Mobile or Compatibility.

LightBakeModeProperty
# LightBakeMode
C#
public Light3D.BakeMode LightBakeMode { get; set; }

The light's bake mode. This will affect the global illumination techniques that have an effect on the light's rendering. Note: Meshes' global illumination mode will also affect the global illumination rendering. See GeometryInstance3D.GIMode.

LightColorProperty
# LightColor
C#
public Color LightColor { get; set; }

The light's color in nonlinear sRGB encoding. An overbright color can be used to achieve a result equivalent to increasing the light's Light3D.LightEnergy.

LightCullMaskProperty
# LightCullMask
C#
public uint LightCullMask { get; set; }

Mask of GeometryInstance3D visual layers affected by the light, not a physics CollisionMask. Switching 1 to 2 excluded geometry left on visual layer 1 in the native check.

LightEnergyProperty
# LightEnergy
C#
public float LightEnergy { get; set; }

Light energy multiplier. Output also depends on material, distance/attenuation, environment, exposure and physical-unit settings. One value is not a universal brightness level across projects.

LightIndirectEnergyProperty
# LightIndirectEnergy
C#
public float LightIndirectEnergy { get; set; }

Secondary multiplier used with indirect light (light bounces). Used with VoxelGI and SDFGI (see Environment.SdfgiEnabled). Note: This property is ignored if Light3D.LightEnergy is equal to 0.0, as the light won't be present at all in the GI shader.

LightIntensityLumensProperty
# LightIntensityLumens
C#
public float LightIntensityLumens { get; set; }

Used by positional lights (OmniLight3D and SpotLight3D) when ProjectSettings.rendering/lights_and_shadows/use_physical_light_units is true. Sets the intensity of the light source measured in Lumens. Lumens are a measure of luminous flux, which is the total amount of visible light emitted by a light source per unit of time. For SpotLight3Ds, we assume that the area outside the visible cone is surrounded by a perfect light absorbing material. Accordingly, the apparent brightness of the cone area does not change as the cone increases and decreases in size. A typical household lightbulb can range from around 600 lumens to 1,200 lumens, a candle is about 13 lumens, while a streetlight can be approximately 60,000 lumens.

LightIntensityLuxProperty
# LightIntensityLux
C#
public float LightIntensityLux { get; set; }

Directional-source illuminance in lux. Use for DirectionalLight3D with physical units enabled; LightEnergy is an additional multiplier. Not a lamp luminous-flux rating in lumens. Does not affect light rendering when physical mode is disabled.

LightNegativeProperty
# LightNegative
C#
public bool LightNegative { get; set; }

If true, the light's effect is reversed, darkening areas and casting bright shadows.

LightProjectorProperty
# LightProjector
C#
public Texture2D LightProjector { get; set; }

Texture2D projected by light. Light3D.ShadowEnabled must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. Note: Unlike BaseMaterial3D whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with ProjectSettings.rendering/textures/light_projectors/filter. Note: Light projector textures are only supported in the Forward+ and Mobile rendering methods, not Compatibility.

LightSizeProperty
# LightSize
C#
public float LightSize { get; set; }

The simulated size of the light in Reckfell units, affecting shading and shadows. For OmniLight3Ds and SpotLight3Ds, increasing this value simulates a spherical area light, expanding the size of specular highlights. If shadows are enabled, a penumbra is rendered, making shadows appear blurrier. For AreaLight3Ds, only the shadows are affected. Penumbras are simulated with percentage-closer soft shadows, or PCSS, which has a noticeable performance cost for values above 0.0. Note: Light3D.LightSize is not affected by Entity3D.Scale (the light's scale or its parent's scale). Note: PCSS for positional lights is only supported in the Forward+ and Mobile rendering methods, not Compatibility.

LightSpecularProperty
# LightSpecular
C#
public float LightSpecular { get; set; }

The intensity of the specular blob in objects affected by the light. At 0, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface.

LightTemperatureProperty
# LightTemperature
C#
public float LightTemperature { get; set; }

Color temperature in Kelvin, active with physical light units enabled. Around 6500 K is approximately neutral; lower values are warmer. Temperature color combines with LightColor in linear space; it does not replace a tinted LightColor with neutral white.

LightVolumetricFogEnergyProperty
# LightVolumetricFogEnergy
C#
public float LightVolumetricFogEnergy { get; set; }

Secondary multiplier multiplied with Light3D.LightEnergy then used with the Environment's volumetric fog (if enabled). If set to 0.0, computing volumetric fog will be skipped for this light, which can improve performance for large amounts of lights when volumetric fog is enabled. Note: To prevent short-lived dynamic light effects from poorly interacting with volumetric fog, lights used in those effects should have Light3D.LightVolumetricFogEnergy set to 0.0 unless Environment.VolumetricFogTemporalReprojectionEnabled is disabled (or unless the reprojection amount is significantly lowered).

ShadowBiasProperty
# ShadowBias
C#
public float ShadowBias { get; set; }

Shadow depth-comparison offset to reduce self-shadowing. Excess can detach shadows from objects. Does not replace appropriate shadow coverage or map resolution; tune with ShadowNormalBias.

ShadowBlurProperty
# ShadowBlur
C#
public float ShadowBlur { get; set; }

Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible.

ShadowCasterMaskProperty
# ShadowCasterMask
C#
public uint ShadowCasterMask { get; set; }

The light will only cast shadows using objects in the selected layers.

ShadowContactShadowsAllowProperty
# ShadowContactShadowsAllow
C#
public bool ShadowContactShadowsAllow { get; set; }

Enables screen-space contact shadows for this light. Only used when ProjectSettings.rendering/lights_and_shadows/contact_shadow/enabled is enabled.

ShadowContactShadowsBlurProperty
# ShadowContactShadowsBlur
C#
public float ShadowContactShadowsBlur { get; set; }

Blurs the edges of the contact shadow. 0.0 produces sharp shadows; higher values increase the noise magnitude. Only used when Light3D.ShadowContactShadowsAllow is enabled.

ShadowContactShadowsOpacityProperty
# ShadowContactShadowsOpacity
C#
public float ShadowContactShadowsOpacity { get; set; }

Changes the opacity of this light's screen-space contact shadows. A value of 1.0 uses the same opacity as Light3D.ShadowOpacity, a value of 0.5 would be 50% of the opacity of Light3D.ShadowOpacity. Only used when Light3D.ShadowContactShadowsAllow is enabled.

ShadowEnabledProperty
# ShadowEnabled
C#
public bool ShadowEnabled { get; set; }

Enables this light’s shadows when supported for its type and renderer. Casters need appropriate CastShadow settings and coverage. DirectionalLight3D shadows are verified in Compatibility; source configuration does not support AreaLight3D shadows there.

ShadowNormalBiasProperty
# ShadowNormalBias
C#
public float ShadowNormalBias { get; set; }

Shadow-building offset along surface normals. Helps with artifacts, but excessive values distort contact and thin details. Does not modify mesh or physics geometry.

ShadowOpacityProperty
# ShadowOpacity
C#
public float ShadowOpacity { get; set; }

The opacity to use when rendering the light's shadow map. Values lower than 1.0 make the light appear through shadows. This can be used to fake global illumination at a low performance cost.

ShadowReverseCullFaceProperty
# ShadowReverseCullFace
C#
public bool ShadowReverseCullFace { get; set; }

If true, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with GeometryInstance3D.ShadowCastingSetting.DoubleSided.

ShadowTransmittanceBiasProperty
# ShadowTransmittanceBias
C#
public float ShadowTransmittanceBias { get; set; }

Methods33

GetAllowContactShadowsbool
# GetAllowContactShadows
C#
public bool GetAllowContactShadows();
Returns bool
GetBakeModeLight3D.BakeMode
# GetBakeMode
C#
public Light3D.BakeMode GetBakeMode();
Returns Light3D.BakeMode
GetColorColor
# GetColor
C#
public Color GetColor();
Returns Color
GetCorrelatedColorColor
# GetCorrelatedColor
C#
public Color GetCorrelatedColor();

Returns the Color of an idealized blackbody at the given Light3D.LightTemperature. This value is calculated internally based on the Light3D.LightTemperature. This Color is multiplied by Light3D.LightColor before being sent to the RenderingServer.

Returns Color
GetCullMaskuint
# GetCullMask
C#
public uint GetCullMask();
Returns uint
GetDistanceFadeBeginfloat
# GetDistanceFadeBegin
C#
public float GetDistanceFadeBegin();
Returns float
GetDistanceFadeLengthfloat
# GetDistanceFadeLength
C#
public float GetDistanceFadeLength();
Returns float
GetDistanceFadeShadowfloat
# GetDistanceFadeShadow
C#
public float GetDistanceFadeShadow();
Returns float
GetParamfloat
# GetParam
C#
public float GetParam(Light3D.Param param);

Returns the value of the specified Light3D.Param parameter.

Parameters
NameTypeDefault
paramLight3D.Param—
Returns float
GetProjectorTexture2D
# GetProjector
C#
public Texture2D GetProjector();
Returns Texture2D
GetShadowCasterMaskuint
# GetShadowCasterMask
C#
public uint GetShadowCasterMask();
Returns uint
GetShadowReverseCullFacebool
# GetShadowReverseCullFace
C#
public bool GetShadowReverseCullFace();
Returns bool
GetTemperaturefloat
# GetTemperature
C#
public float GetTemperature();

Returns the current LightTemperature value. Color temperature in Kelvin, active with physical light units enabled. Around 6500 K is approximately neutral; lower values are warmer. Temperature color combines with LightColor in linear space; it does not replace a tinted LightColor with neutral white.

Returns float

Current LightTemperature value in the units described for that property.

HasShadowbool
# HasShadow
C#
public bool HasShadow();
Returns bool
IsDistanceFadeEnabledbool
# IsDistanceFadeEnabled
C#
public bool IsDistanceFadeEnabled();
Returns bool
IsEditorOnlybool
# IsEditorOnly
C#
public bool IsEditorOnly();
Returns bool
IsNegativebool
# IsNegative
C#
public bool IsNegative();
Returns bool
SetAllowContactShadowsvoid
# SetAllowContactShadows
C#
public void SetAllowContactShadows(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetBakeModevoid
# SetBakeMode
C#
public void SetBakeMode(Light3D.BakeMode bakeMode);
Parameters
NameTypeDefault
bakeModeLight3D.BakeMode—
SetColorvoid
# SetColor
C#
public void SetColor(Color color);
Parameters
NameTypeDefault
colorColor—
SetCullMaskvoid
# SetCullMask
C#
public void SetCullMask(uint cullMask);
Parameters
NameTypeDefault
cullMaskuint—
SetDistanceFadeBeginvoid
# SetDistanceFadeBegin
C#
public void SetDistanceFadeBegin(float distance);
Parameters
NameTypeDefault
distancefloat—
SetDistanceFadeLengthvoid
# SetDistanceFadeLength
C#
public void SetDistanceFadeLength(float distance);
Parameters
NameTypeDefault
distancefloat—
SetDistanceFadeShadowvoid
# SetDistanceFadeShadow
C#
public void SetDistanceFadeShadow(float distance);
Parameters
NameTypeDefault
distancefloat—
SetEditorOnlyvoid
# SetEditorOnly
C#
public void SetEditorOnly(bool editorOnly);
Parameters
NameTypeDefault
editorOnlybool—
SetEnableDistanceFadevoid
# SetEnableDistanceFade
C#
public void SetEnableDistanceFade(bool enable);
Parameters
NameTypeDefault
enablebool—
SetNegativevoid
# SetNegative
C#
public void SetNegative(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetParamvoid
# SetParam
C#
public void SetParam(Light3D.Param param, float value);

Sets the value of the specified Light3D.Param parameter.

Parameters
NameTypeDefault
paramLight3D.Param—
valuefloat—
SetProjectorvoid
# SetProjector
C#
public void SetProjector(Texture2D projector);
Parameters
NameTypeDefault
projectorTexture2D—
SetShadowvoid
# SetShadow
C#
public void SetShadow(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetShadowCasterMaskvoid
# SetShadowCasterMask
C#
public void SetShadowCasterMask(uint casterMask);
Parameters
NameTypeDefault
casterMaskuint—
SetShadowReverseCullFacevoid
# SetShadowReverseCullFace
C#
public void SetShadowReverseCullFace(bool enable);
Parameters
NameTypeDefault
enablebool—
SetTemperaturevoid
# SetTemperature
C#
public void SetTemperature(float temperature);

Sets LightTemperature. Color temperature in Kelvin, active with physical light units enabled. Around 6500 K is approximately neutral; lower values are warmer. Temperature color combines with LightColor in linear space; it does not replace a tinted LightColor with neutral white.

Parameters
NameTypeDefault
temperaturefloat—
temperature

Color temperature in Kelvin, active with physical light units enabled. Around 6500 K is approximately neutral; lower values are warmer. Temperature color combines with LightColor in linear space; it does not replace a tinted LightColor with neutral white.

Light3D.BakeMode

ValueDescription
Disabled = 0

Light is ignored when baking. This is the fastest mode, but the light will not be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. Note: Hiding a light does not affect baking LightmapGI. Hiding a light will still affect baking VoxelGI and SDFGI (see Environment.SdfgiEnabled).

Dynamic = 2

Light is taken into account in dynamic baking (VoxelGI and SDFGI (Environment.SdfgiEnabled)). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to Light3D.BakeMode.Static. This has a greater performance cost compared to Light3D.BakeMode.Static. When using SDFGI, the update speed of dynamic lights is affected by ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights. Note: When using LightmapGI, the light's indirect light is baked, but direct light and shadows remain real-time. This mode allows performing subtle changes to a light's color, energy, and position while still looking fairly correct. For example, you can use this to create flickering static torches that have their indirect light baked.

Static = 1

Light is taken into account in static baking (VoxelGI, LightmapGI, SDFGI (Environment.SdfgiEnabled)). The light can be moved around or modified, but its global illumination will not update in real-time. Note: The light is not baked in LightmapGI if Light3D.EditorOnly is true. Note: When using LightmapGI, both the direct and indirect light are baked. Since direct light is baked, the light doesn't display a specular lobe on static lightmapped meshes. Shadows on static lightmapped meshes will also look less detailed, but the light still casts shadows that can be displayed on dynamic objects. Since real-time light computations are skipped on static lightmapped meshes, this bake mode improves runtime performance compared to Light3D.BakeMode.Dynamic and Light3D.BakeMode.Disabled.

Light3D.Param

ValueDescription
Attenuation = 6

Constant for accessing OmniLight3D.OmniAttenuation or SpotLight3D.SpotAttenuation.

ContactShadowBlur = 22

Constant for accessing Light3D.ShadowContactShadowsBlur.

ContactShadowOpacity = 21

Constant for accessing Light3D.ShadowContactShadowsOpacity.

Energy = 0

Constant for accessing Light3D.LightEnergy.

IndirectEnergy = 1

Constant for accessing Light3D.LightIndirectEnergy.

Intensity = 20

Constant for accessing Light3D.LightIntensityLumens and Light3D.LightIntensityLux. Only used when ProjectSettings.rendering/lights_and_shadows/use_physical_light_units is true.

Max = 23

Represents the size of the Light3D.Param enum.

Range = 4

Constant for accessing OmniLight3D.OmniRange or SpotLight3D.SpotRange.

ShadowBias = 15

Constant for accessing Light3D.ShadowBias.

ShadowBlur = 18

Constant for accessing Light3D.ShadowBlur.

ShadowFadeStart = 13

Constant for accessing DirectionalLight3D.DirectionalShadowFadeStart.

ShadowMaxDistance = 9

Constant for accessing DirectionalLight3D.DirectionalShadowMaxDistance.

ShadowNormalBias = 14

Constant for accessing Light3D.ShadowNormalBias.

ShadowOpacity = 17

Constant for accessing Light3D.ShadowOpacity.

ShadowPancakeSize = 16

Constant for accessing DirectionalLight3D.DirectionalShadowPancakeSize.

ShadowSplit1Offset = 10

Constant for accessing DirectionalLight3D.DirectionalShadowSplit1.

ShadowSplit2Offset = 11

Constant for accessing DirectionalLight3D.DirectionalShadowSplit2.

ShadowSplit3Offset = 12

Constant for accessing DirectionalLight3D.DirectionalShadowSplit3.

Size = 5

Constant for accessing Light3D.LightSize.

Specular = 3

Constant for accessing Light3D.LightSpecular.

SpotAngle = 7

Constant for accessing SpotLight3D.SpotAngle.

SpotAttenuation = 8

Constant for accessing SpotLight3D.SpotAngleAttenuation.

TransmittanceBias = 19

Constant for accessing Light3D.ShadowTransmittanceBias.

VolumetricFogEnergy = 2

Constant for accessing Light3D.LightVolumetricFogEnergy.

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.