SpotLight QML Type

Defines a spot light in the scene. More...

Import Statement: import QtQuick3D 1.15
Since: Qt 5.15
Inherits:

Light

Properties

Detailed Description

The spot light emits light towards one direction in a cone shape, which is defined by the coneAngle property. The light intensity diminishes when approaching the coneAngle. The angle at which the light intensity starts to diminish is defined by innerConeAngle. Both angles are defined in degrees.

Inside the innerConeAngle, the spot light behaves similarly to the point light. There the light intensity diminishes according to inverse-square-law. However, the fade-off (and range) can be controlled with the constantFade, linearFade, and quadraticFade properties.

See also DirectionalLight, PointLight, and AreaLight.

Property Documentation

coneAngle : real

This property defines the cut-off angle beyond which the light doesn't affect the scene. Defined in degrees between 0 and 180. The default value is 40.


constantFade : real

This property is constant factor of the attenuation term of the light. The default value is 1.0.


innerConeAngle : real

This property defines the angle at which the light intensity starts to gradually diminish as it approaches coneAngle. Defined in degrees between 0 and 180. If the value is set larger than coneAngle, it'll behave as if it had the same value as coneAngle. The default value is 30.


linearFade : real

This property increases the rate at which the lighting effect dims the light in proportion to the distance to the light. The default value is 0.0, which means the light doesn't have linear fade.


quadraticFade : real

This property increases the rate at which the lighting effect dims the light in proportion to the inverse square law. The default value is 1.0, which means the spot light fade exactly follows the inverse square law, i.e. when distance to an object doubles the light intensity decreases to 1/4th.