To improve speed:
1. Reduce shadow resolution. You shouldn't need to go lower than 128x128 though.
2. Disable shadow blurring. At 128x128 they'll be blurry enough.
3. Use fewer shadows by reducing the number of lights, or the number of casters, or reducing the light radius so fewer objects get hit by each light.
4. Split your level into multiple smaller meshes, and split off portions which don't need to recieve shadows. This is probably the most important thing. If you have a terrain with all sorts of foliage for example, not only should that terrain be broken up into smaller sections, but those trees and ferns don't really need to recieve shadows, and allowing them to can kill your framerate.
The reason splitting your level up will speed up the shadow system is because the shadow system first checks a bounding sphere for the object to see if the shadow frustrum is intersecting it. If it isn't all the polygons in that object can be discarded immediately. If on the other hand your level is one big solid object, then all 65,000 polygons in it have to be checked against the shadow frustums. And even though I optimized the hell out of that, that's still way too much work to do.
In most cases, you should have your level split up anyway, because you're throwing away a lot of framerate if you don't.
One last thing to make sure of. Make sure you are only running the shadow system once per render! Mark's demos used updates at fixed intervals, and ran the inner loop multiple times per renderworld if neccessary. But it is a total waste of time to update the shadows inside those loops. You only have to update the shadows once before you render each frame.
1. Reduce shadow resolution. You shouldn't need to go lower than 128x128 though.
2. Disable shadow blurring. At 128x128 they'll be blurry enough.
3. Use fewer shadows by reducing the number of lights, or the number of casters, or reducing the light radius so fewer objects get hit by each light.
4. Split your level into multiple smaller meshes, and split off portions which don't need to recieve shadows. This is probably the most important thing. If you have a terrain with all sorts of foliage for example, not only should that terrain be broken up into smaller sections, but those trees and ferns don't really need to recieve shadows, and allowing them to can kill your framerate.
The reason splitting your level up will speed up the shadow system is because the shadow system first checks a bounding sphere for the object to see if the shadow frustrum is intersecting it. If it isn't all the polygons in that object can be discarded immediately. If on the other hand your level is one big solid object, then all 65,000 polygons in it have to be checked against the shadow frustums. And even though I optimized the hell out of that, that's still way too much work to do.
In most cases, you should have your level split up anyway, because you're throwing away a lot of framerate if you don't.
One last thing to make sure of. Make sure you are only running the shadow system once per render! Mark's demos used updates at fixed intervals, and ran the inner loop multiple times per renderworld if neccessary. But it is a total waste of time to update the shadows inside those loops. You only have to update the shadows once before you render each frame.