reckfellENGINE

AreaLight3D

An area light, such as a neon light tube or a screen.

On this page
class AreaLight3DReckfellSharpInherits Light3D

An area light, such as a neon light tube or a screen.

An area light is a type of Light3D node that emits light over a two-dimensional area, in the shape of a rectangle. The light is attenuated throughout the distance. This attenuation can be configured by changing the energy, AreaLight3D.AreaAttenuation, and AreaLight3D.AreaRange. Light is emitted in the -Z direction of the node's global basis. For an unrotated light, this means that the light is emitted forwards, illuminating the front side of a 3D model (see Vector3.Forward and Vector3.ModelFront). Area lights can cast soft shadows using PCSS, which you can control by tweaking the size parameter. The shadow map is drawn from the center of the light. Note: Area lights have limited support in the Mobile and Compatibility renderers. In the Mobile renderer, the size of the penumbra doesn't vary as it should with PCSS. In Compatibility, area lights cannot cast shadows. Warning: Shadows cast by an area light may look incorrect if the object casting shadows doesn't have enough subdivisions and it's very close to the area light. This is the same limitation as the Dual Paraboloid shadow mode on an OmniLight3D. Performance: Area lights are more demanding on the GPU compared to omni and spot lights. In Forward+, there is an additional GPU cost on all rendered objects as soon as one area light is present in the view frustum (due to the nature of clustered lighting). Consider using them only for cinematics or when targeting high-end devices.

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

Constructors1

AreaLight3DConstructor
# AreaLight3D
C#
public AreaLight3D();

Properties5

AreaAttenuationProperty
# AreaAttenuation
C#
public float AreaAttenuation { get; set; }

Controls the distance attenuation function for this area light. A value of 0.0 will maintain a constant brightness through most of the range, but will smoothly attenuate the light at the edge of the range. Use a value of 2.0 for physically accurate lights as it results in the proper inverse square attenuation. Note: Setting attenuation to 2.0 or higher may result in distant objects receiving minimal light, even when within range. For example, with a range of 4096, an object at 100 units is attenuated by a factor of 0.0001. With a default brightness of 1, the light would not be visible at that distance. Note: Using negative values or values higher than 10.0 may lead to unexpected results.

AreaNormalizeEnergyProperty
# AreaNormalizeEnergy
C#
public bool AreaNormalizeEnergy { get; set; }

Defines whether the energy is normalized (divided) by the surface area of the light. If set to true, changing the size does not affect the total energy output, and does not dramatically alter the brightness of the scene.

AreaRangeProperty
# AreaRange
C#
public float AreaRange { get; set; }

The range of the area in meters. This determines the maximum distance from any point on the area at which the area can still emit light.

AreaSizeProperty
# AreaSize
C#
public Vector2 AreaSize { get; set; }

The extents (width and height) of the area in meters.

AreaTextureProperty
# AreaTexture
C#
public Texture2D AreaTexture { get; set; }

An optional texture to use as a light source. Changing the texture at runtime might impact performance, as it needs to be drawn to the area light atlas with filtered mipmaps. If no texture is assigned, the area light emits uniform light across its surface. Note: Area light textures are only supported in the Forward+ and Mobile rendering methods, not Compatibility. To reduce the performance impact of switching textures at runtime, make sure each dimension of an area texture is either a multiple of 128 pixels, or a power of two. This removes the need for a scaling pass, which slows down texture changes. The textures don't necessarily have to be square to be optimal. Examples of optimal texture sizes include 32×64, 128×128, and 256×384.

Methods6

GetAreaSizeVector2
# GetAreaSize
C#
public Vector2 GetAreaSize();
Returns Vector2
GetAreaTextureTexture2D
# GetAreaTexture
C#
public Texture2D GetAreaTexture();
Returns Texture2D
IsAreaNormalizingEnergybool
# IsAreaNormalizingEnergy
C#
public bool IsAreaNormalizingEnergy();
Returns bool
SetAreaNormalizeEnergyvoid
# SetAreaNormalizeEnergy
C#
public void SetAreaNormalizeEnergy(bool enable);
Parameters
NameTypeDefault
enablebool—
SetAreaSizevoid
# SetAreaSize
C#
public void SetAreaSize(Vector2 areaSize);
Parameters
NameTypeDefault
areaSizeVector2—
SetAreaTexturevoid
# SetAreaTexture
C#
public void SetAreaTexture(Texture2D texture);
Parameters
NameTypeDefault
textureTexture2D—
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.