I've set up a directional light to mimic the sun in an open area and that's how I'm doing it:
Code: Select all
irr::scene::ILightSceneNode *pLight = pSceneMgr->addLightSceneNode( 0, irr::core::vector3df( 0, 0, 0 ), irr::video::SColorf( 0.8, 0.8, 0.8 ) );
pLight->setLightType( irr::video::ELT_DIRECTIONAL );
pLight->enableCastShadow( 1 );
pLight->getLightData().Direction = irr::core::vector3df( -1, -1, 0 ).normalize();
Also, that's how I initialize the shadow volumes:
Code: Select all
pNode = pScnMgr->addMeshSceneNode( pMesh );
pShadow = ( (irr::scene::IMeshSceneNode*)pNode )->addShadowVolumeSceneNode();
Thanks in advance