Class TCastleSpotLight

Unit

Declaration

type TCastleSpotLight = class(TCastlePunctualLight)

Description

Spot light shines a cone of light, from a given location, along a direction (-Z in local coordinates).

See X3D SpotLight specification for various details.

Source: src/scene/castlescene_spotlight.inc (line 27).

Hierarchy

Overview

Fields

Public nested const DefaultBeamWidth = Pi * 3 / 16;
Public nested const DefaultCutOffAngle = Pi / 4;
Public nested const DefaultRadius = 100.0;
Public nested const DefaultIntensity = 100.0;

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Public property Color: TCastleColorRGB read FColor write SetColor;
Public property Attenuation: TVector3 read FAttenuation write SetAttenuation;
Published property Intensity: Single read FIntensity write SetIntensity default DefaultIntensity;
Published property Radius: Single read FRadius write SetRadius default DefaultRadius;
Published property BeamWidth: Single read FBeamWidth write SetBeamWidth default DefaultBeamWidth;
Published property CutOffAngle: Single read FCutOffAngle write SetCutOffAngle default DefaultCutOffAngle;
Published property ColorPersistent: TCastleColorRGBPersistent read FColorPersistent ;
Published property AttenuationPersistent: TCastleVector3Persistent read FAttenuationPersistent ;

Description

Fields

Public nested const DefaultBeamWidth = Pi * 3 / 16;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 50).

Public nested const DefaultCutOffAngle = Pi / 4;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 51).

Public nested const DefaultRadius = 100.0;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 52).

Public nested const DefaultIntensity = 100.0;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 53).

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 55).

Public destructor Destroy; override;

This item has no description.

Source: src/scene/castlescene_spotlight.inc (line 56).

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Source: src/scene/castlescene_spotlight.inc (line 57).

Properties

Public property Color: TCastleColorRGB read FColor write SetColor;

Light color shining over surface. By default white.

Source: src/scene/castlescene_spotlight.inc (line 60).

Public property Attenuation: TVector3 read FAttenuation write SetAttenuation;

Attenuation determines how quickly light intensity falls off with distance. By default Vector3(0, 0, 1), which means light falls off according to inverse square law.

Source: src/scene/castlescene_spotlight.inc (line 64).

Published property Intensity: Single read FIntensity write SetIntensity default DefaultIntensity;

Intensity, multiplied by color. Can be anything >= 0. Intuitively, how bright is the light.

Following glTF lights specification, the spot light's intensity physical unit is luminous intensity in candela (lm/sr). This is exactly like TCastlePointLight, but different than TCastleDirectionalLight.

The default intensity is 100.0, which is a reasonable value for a point/spot light, it remains bright for a few meters around the light source.

Source: src/scene/castlescene_spotlight.inc (line 76).

Published property Radius: Single read FRadius write SetRadius default DefaultRadius;

Light doesn't shine at all outside of a sphere with this radius. For performance reasons, set this as small as possible, to avoid even considering this light at further shapes. Set to -1 to have no limit.

Source: src/scene/castlescene_spotlight.inc (line 82).

Published property BeamWidth: Single read FBeamWidth write SetBeamWidth default DefaultBeamWidth;

Angle within which the spot light has maximum intensity.

If this is >= CutOffAngle (which is the default case), then the light has maximum intensity within CutOffAngle, and zero intensity outside CutOffAngle, and there it no smooth falloff.

You need to make BeamWidth < CutOffAngle to have a smooth falloff at the egdes of the spot light.

Source: src/scene/castlescene_spotlight.inc (line 92).

Published property CutOffAngle: Single read FCutOffAngle write SetCutOffAngle default DefaultCutOffAngle;

Angle within which the spot light has any intensity.

If BeamWidth < CutOffAngle then the light intensity falls off smoothly between BeamWidth and CutOffAngle.

The light intensity is always zero outside of CutOffAngle, regardless of the BeamWidth value.

Source: src/scene/castlescene_spotlight.inc (line 101).

Published property ColorPersistent: TCastleColorRGBPersistent read FColorPersistent ;

Color that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Color directly.

See also
Color
Light color shining over surface.

Source: src/scene/auto_generated_persistent_vectors/tcastlespotlight_persistent_vectors.inc (line 37).

Published property AttenuationPersistent: TCastleVector3Persistent read FAttenuationPersistent ;

Attenuation that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Attenuation directly.

See also
Attenuation
Attenuation determines how quickly light intensity falls off with distance.

Source: src/scene/auto_generated_persistent_vectors/tcastlespotlight_persistent_vectors.inc (line 105).


Generated by PasDoc 0.17.0.snapshot.