Shadows Performance?

Started by
5 comments, last by _the_phantom_ 19 years, 4 months ago
I'm trying to implement shadows in my program but I don't have a clue how many things I can add shadows to. For example: If I add stencil shadows to my world, what is the maximum shadowed polygon I can have? BTW Any benchmark about shadows will be greatly appreciated. Thanks a lot.
---------------------------- ^_^
Advertisement
Within reason, there really aren't any maximums. The performance will simply decrease as geometry and shadow complexity increases. I suggest you go ahead an implement it, then experiment with detail levels.

For a general idea of stencil shadow performance, you could have a play with Doom 3.
There are many different ways of doing shadows, depending on how you want your game to look. They will all have different performance characteristics.

+ You could do stencil shadows like Doom3. There are plenty of tricks to make this faster. For example, you can use lower-resolution models to cast the shadows.
+ Or you could do lightmaps for static level geometry and shadow maps for characters etc., like HL2
+ Or just simple lightmaps plus a dark blob underneath players (actually works quite well!)
+ Old flight sims with completely (or mostly) flat ground could just project the plane onto the ground using some simple math. Very limited, but also very fast

Basically, you'll need to pick a method that you think will work well with YOUR game, and then see how well it runs. If it's too slow, you can attempt to optimize it, pick a simpler/faster method, or scale down something else instead. It's not easy to predict how fast things will go in one specific situation without trying it - in fact, it's hard to even tell what will be an acceptable speed.
you forgot shadow maps from the list above as well
why I downed the shadow map demo all are very slow.
Quote:Original post by uavfun

Basically, you'll need to pick a method that you think will work well with YOUR game, and then see how well it runs. If it's too slow, you can attempt to optimize it, pick a simpler/faster method, or scale down something else instead. It's not easy to predict how fast things will go in one specific situation without trying it - in fact, it's hard to even tell what will be an acceptable speed.


Great :) , more long nights for me :(

Well at least when its done I will know a little bit more about shadows.

Thanks.
---------------------------- ^_^
Quote:Original post by yjh1982
why I downed the shadow map demo all are very slow.


which ones and on what card?
The biggest killer on shadow maps is the fact you have to render the scene n+1 times (where n is the number of lights which cast shadows) which can slow things down a fair amount if you have alot of lights and need to copy (ATI problem as you cant render directly to a depth buffer, there are ways around it however)

and frankly, shadow maps (and things like them) are the future (Unreal3 engine and whatever iD work on next are both using them), because they are ALOT easier to work with, more GPU based and you get automagical self shadowing.

This topic is closed to new replies.

Advertisement