DavidGraham
Veteran
So the days of Doom 3 are long gone, how do modern engines handle shadows now ? do they use stencil shadow volumes or just ray trace the hell out of them?
Shadow mapping costs quite a bit because you need to render the scene geometry to each shadow map in addition to the visible render target. Even in the simplest case (dynamic sun light with shadow mapping and no local lights) shadow mapping doubles the draw call count (and doubles the scene triangle count). Each local light source adds to that cost. The shorter light radius, the smaller increase of draw calls. In our games we don't bake any lights (no light maps or probes), thus we have quite a few dynamic shadow mapped light sources. A rough ballpark figure would be that this kind of dynamic lighting pipeline (shadow map rendering) submits around 2x-3x extra draw calls on top of the visible geometry rendering to back buffer.What about the cost of shadow mapping nowadays ? many prime games limits the amount of dynamic shadows as much as possible .. for example the jump from Metro 2033 to Last Light saw shadows from muzzle flashes and explosions stripped away to boost fps .. by how much I wonder? Crysis 1 also had muzzle flashes shadows, but Warhead and Crysis 2 and 3 dropped them like the plague.
Crytek has also their LPV (light propagation volumes): http://www.crytek.com/download/Light_Propagation_Volumes.pdfAre there any realtime GI solutions out there that don't rely on screen-space information? The only solutions I'm aware of (e.g. Crysis 3) are screen-space effects, which obviously can't be used to fully light the game world.
Metro 2033 is the only game with so many shadow casting lights, it has shadows for player flash light, NPC flash lights , player muzzle flash , NPC muzzle flashes , even explosions ! never seen anything like it.
Phew, that is even greater than I expected ! thanks a lot for the great insight.Shadow mapping is definitely heavy for both CPU and GPU. In our last game, it took around 25% of our GPU time and almost half of our rendering engine CPU time (our rendering engine has two dedicated CPU cores on x360).
Just wanted to correct myself, Metro LL does have flashlight (player/NPCs) and explosions shadows, even fire from incendiary grenades cast them too. just not muzzle flahes , in that respect MLL jointed the club of Crysis2,3 .. all of them got rid of muzzle flashes for good!Metro:LL solves it by using only one shadow map per object from what i've seen.
Dunno why C2 or C3 do not support muzzle flash shadows, because they are quite cheap in SDK, there are several mods for that. Its especially strange, considering that some scenes in C3 and even C2 have like 20 visible shadow casting light sources. Adding two, three more from muzzle flashes shouldnt be as performance intensive.
Thanks as always for the insight sebbbi
I guess we aren't quite there yet wrt a fully dynamic, realtime lighting system. Though it would be cool to see a tech demo of a complex scene that is 100% lit in realtime, even if it takes 200ms per frame.