Archived

This topic is now archived and is closed to further replies.

SikCiv

How do shadows work in 3D?

Recommended Posts

Viewing some screenshots of the new Abe''s Munch XBox game, I noticed the level of detail of the shadows on the ground and it got me wandering, are the shadows a feature of the GeForce cards'' T&L capability or do the shadows have to be calculated and drawn by software?

  Game Download  ZeroOne Realm

Share this post


Link to post
Share on other sites
The geForce 3 (and presumably the XBox) support a feature called hardware shadow buffers (find the docs on the nVidia site). The problem is, they are not supported by DX8 (yet...) but they do work in OpenGL.

The performance of this feature on the geForce 3 doesn''t seem amazingly incredible, and for the moment, you''d probably want to do them in software to suit your needs.

There are couple of ways to do it - there are good docs at nVidia explaining different methods. I think the coolest one (and I think this is basically how the hardware feature works) is when you create a depth map of the light''s viewpoint and a depth map from the light in the camera''s viewpoint and use a combination of texture matrices and pixel shaders to basically say - if this pixel if farther from the light in the camera view than in the light view, it must be in shadow. This works great for selfshadowing and I think that''s what alot of the new XBox games are doing.

The short answer - there are software algorithms, but much of the hard work can be hardware accelerated / streamlined with shaders, etc.

Share this post


Link to post
Share on other sites