Shadow Maps or Shadow Volumes?

Started by
13 comments, last by jpventoso 15 years, 4 months ago
I'm writing a space game. Well, i'm trying to do it :) I've implemented a simple shadow support, using shadow map tecnique, but it's a bit imprecise and needs spotlights. The sun is a pointlight and it could be a problem (i think to rotate the spotlight always to point direct to the camera to give the impression of a omnidiretional light, but...) I've just discovered that there's another tecnique, called "shadow volume" that is more precise, but also more time-consuming. Now i need a suggestion: is it usable into a game or is too heavy? Should i use volumes or maps? Thank you!
Advertisement
The field of shadowing in real-time graphics is open to endless debate across the entire spectrum really. It can be very hard to match up your typical scene against performance characteristics and quality trade-offs.

I'd recommend you dig through the depths of Ysaneya's Developer Journal (hosted on this site) as there are lots of technical discussions on shadows for a space-based game that you might find useful.

Also, remember you can use a hybrid solution - there is no rule stating you must choose one single shadowing algorithm for all cases [wink]

As an observation, the soft-shadowing techniques that tend to be a big part of any shadow mapping algorithm probably aren't of such interest to you. In space there will be less (or no) interreflection or atmospheric scattering thus you'll usually (always?) get sharp edged shadowing...


hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

As jollyjeffers says, there are many shadowing solutions, you just need to find the best one for your situation.
To your question about the usability of shadow volumes in games I would have to say a qualified yes. The thing about shadow volumes is that their efficiency if bound to the complexity of geometry, so if your space-crafts have a lot of vertices, you could/will see some poor performance. Shadow volumes do give nice crisp shadows though, which look good in space!
There are a few techniques you can use to speed up shadow volumes, one of which is to use low-res models when calculating the capped shadow volume.
Steele.
If you're interested, i wrote a tutorial about 21 pages about shadow volume...ZPass, ZFail, pro and what does not work in technique.

http://xvincentx.netsons.org/programBlog/?p=189
The eternal question :)

I started with shadow volumes and then moved to shadow maps because shadow volumes required a great amount of polygons on my dynamic meshes, and it's harder to implement with soft edges. You can see the rough shadow volume edges on this screenshot:



Shadow mapping needs less vertex processing time but it requires some additional filters to look decent:



If you choose shadow volumes, they will work fine with all kinds of lighting but it will be really slow with high poly models.
If you go with shadow mapping, and you need a point light as the sun, you'll need to render the depth into a cube texture, and that means 6 additional renders per scene. But it looks good, and it's not THAT expensive. This screenshot was rendered using shadow mapping with a cube texture and taking 4 samples to soft the shadow edges:



And finally, remember that most of current graphics cards supports hardware acceleration for shadowing. Most ATI cards and nVidia cards supports hardware shadow mapping (http://developer.nvidia.com/object/hwshadowmap_paper.html) and it could be implemented on cube textures with a few tricks. nVidia cards with UltraShadow technology will also speed up shadow volume rendering (http://www.nvidia.com/object/feature_ultrashadow2.html). The speed gain by using hardware shadows goes from 150% to 300% approx.

Hope this helps. Good luck!
Quote:Original post by XVincentX
If you're interested, i wrote a tutorial about 21 pages about shadow volume...ZPass, ZFail, pro and what does not work in technique.

http://xvincentx.netsons.org/programBlog/?p=189


This would seem quite interesting... Is there an English version available?
thank you all very much!

For now i'm trying to use the shadow maps.

These are the actually results:

">youtube video
Quote:Original post by Rompa
Quote:Original post by XVincentX
If you're interested, i wrote a tutorial about 21 pages about shadow volume...ZPass, ZFail, pro and what does not work in technique.

http://xvincentx.netsons.org/programBlog/?p=189


This would seem quite interesting... Is there an English version available?



Sorry, but for now it's aviable only in Italiano. Translation is in planning
Quote:Original post by PdG
">youtube video

Looking good! What kind of shadow mapping technique are you using on that video?

(Just remember that if you want to use Variance Shadow Mapping you wont be able to use hardware acceleration...)

Congrats!
Quote:Original post by jpventoso
(Just remember that if you want to use Variance Shadow Mapping you wont be able to use hardware acceleration...)


Well with VSM you get hardware-accelerated anisotropic filtering and mip-mapping, of course.

This topic is closed to new replies.

Advertisement