The TLight class models a light source in the FMX framework. There are three different kinds of lights:
- Spot
- Directional
- Point
You can set the LightType property of a TLight instance to switch the light type for that instance. There are also a number of other details you can set up, including the positioning and orientation of the light source. For some types (that is, Spot) there are additional parameters, such as the spot cut-off angle (SpotCutOff property in degrees) and the light intensity (SpotExponent – the higher the value for this parameter, the more focused the light beam will be), that you can set.
In the following screenshot, you can see what happens when you switch off the light in the last project we discussed (the Viewport demo):
However, keep in mind that FMX does not provide a shadow-casting system. Instead, setting lights means defining the lightmap for the scene in order to determine how to render 3D objects...