From: <jo...@us...> - 2004-08-31 11:23:17
|
Update of /cvsroot/crystal/CS/plugins/engine/3d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1510/plugins/engine/3d Modified Files: light.cpp Log Message: - Jorrit did a huge optimization and cleanup on dynamic lights (old style dynamic lights which do NOT use stencil hardware). Pressing 'L' in walktest (which adds a huge dynamic light at the current spot) improved from 22 seconds to something slightly bigger then 0 seconds (for a big level). To do this I had to remove support for shadows. I don't think shadows for dynamic lights are that important. They will still correctly shadow if they shine through a portal (i.e. the portal boundary). Index: light.cpp =================================================================== RCS file: /cvsroot/crystal/CS/plugins/engine/3d/light.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- light.cpp 1 Aug 2004 08:16:46 -0000 1.9 +++ light.cpp 31 Aug 2004 11:23:07 -0000 1.10 @@ -503,9 +503,29 @@ ctxt->SetNewLightFrustum (new csFrustum (center)); ctxt->GetLightFrustum ()->MakeInfinite (); - sector->CheckFrustum ((iFrustumView *) &lview); - lpi->FinalizeLighting (); + if (dynamic_type == CS_LIGHT_DYNAMICTYPE_DYNAMIC) + { + csRef<iMeshWrapperIterator> it = csEngine::current_engine + ->GetNearbyMeshes (sector, center, GetInfluenceRadius ()); + while (it->HasNext ()) + { + iMeshWrapper* m = it->Next (); + iShadowReceiver* receiver = m->GetShadowReceiver (); + if (receiver) + { + receiver->CastShadows (m->GetMovable (), &lview); + csMeshWrapper* cmw = ((csMeshWrapper::MeshWrapper*)m) + ->GetCsMeshWrapper (); + cmw->InvalidateRelevantLights (); + } + } + } + else + { + sector->CheckFrustum ((iFrustumView *) &lview); + lpi->FinalizeLighting (); + } } void csLight::CalculateLighting (iMeshWrapper *th) |