Enable Shadow Mapping
First, a light that supports shadow mapping is needed for this to be efficient:
A spot light (Setup a Spot Light)
A beam light (Setup a Beam Light)
Point lights also support shadow mapping, but this is a 6 pass process, that is taking more time (Setup a Point Light)
Then:
RED::ILightShape* ilight = light->As< RED::ILightShape >();
RC_TEST( ilight->SetShadowMapping( true, iresmgr->GetState() ) );
All the methods needed to configure a shadow map are detailed in the doc Real-Time Lights under the section Configuring Shadow Mapping.