Search code examples
delphifiremonkey

How do I make a TLight show in Delphi FMX


I am trying to make a 3D application where a TLight casts light in a 3D cube, but I found no way to "enable" the light and it does nothing.


Solution

  • The MaterialSource of your cube needs to be a TLightMaterial. Do that by putting a TLightMaterialSource on your form and hooking it up to the cube. To make it easier to see make the light a point source. Once done and looking similar to the below you can move the lightsource around and see the cube lit differently.

    enter image description here