Turning on Ray-Traced Shadows
All HOOPS Luminate lights do support ray-traced shadows (exception made of the ambient light of course, but can we call it a real light?). Ray-traced shadows may produce hard shadows or soft shadows, depending on the light source geometry: all centric or directional lights that have no light emitting surface will produce hard shadows. All lights sources that have a light emitting surface will produce smooth shadows.
Ray-traced shadows can be enabled using the following code:
// Disable shadow mapping that has precedence over ray-traced shadows and turn on shadows on the light:
RED::ILightShape* ilight = light->As< RED::ILightShape >();
RC_TEST( ilight->SetShadowMapping( false, iresmgr->GetState() ) );
RC_TEST( ilight->SetRenderMode( RED::RM_SHADOW_CASTER, 1, iresmgr->GetState() ) );
Shadow mapping must be disabled, as whenever enabled, it’ll override ray-traced shadows. Then, the light needs to cast shadows and that’s all.