Coming back to this a bit late, but I do remember that you could do a drawShadow override, if you have a specific LOD setting that is available(assuming all objects you have have atleast base and one additional LOD level) there is alot of performance to be had there, further is another if you know that your worst LOD setting maintains the correct shape of the object or close enough to the original shape that you know that the shadow cast will be 99% the same you can do something like
this example is using the drawShadow function of static
Code:
void drawShadow()
{
if(mesh && actor.is())
{
if(Frustum(*mesh, T.matrixScaled()))
{
SetVariation(mesh_variation); mesh->lod(mesh->lods()-1).drawShadow(T.matrixScaled());
SetVariation();
}
}
}
using something like the default Barrel object, compared to using
Code:
mesh->drawShadow(T.matrixScaled());
10,000 barrels as static objects, there is a decent performance gain for me
the difference is 1331 vtxs,2180 triangles, and two meshparts.
the final lod in this example I have set the distance to one thousand just to make sure I do not see this super simplified body rendered normally and even if it is, if it is that far away you won't be able to tell it being a single material is at
583vtxs, 504 triangles, and one meshpart
this not only helps GPU performance but also CPU performance because setting up draw calls isn't free, so two parts per mesh, or having an unreasonable detailed mesh being cast as the shadow is wasted GPU bandwidth and CPU and GPU processing.
if there are certain things you know will only be affected by local lights like light point and cone, you can look into using something like
Code:
if(mesh && actor.is() && CurrentLight.type==LIGHT_POINT)
so even if there is a directional sun outside but you know these objects won't recieve that light, then you can block it off. if you are using custom bounding volumes of objects to cull you could move this light_point check to the bounding volume instead perhaps to only have to check it once for all the objects inside.