View Single Post
Old 08-03-04, 03:13 PM   #14
Registered User
Zeno's Avatar
Join Date: Aug 2002
Location: San Diego, CA
Posts: 106
Default Re: Doom 3 pre-rendered "dynamic shadows" ?

Originally Posted by Sazar
just a little investigation into doom 3's shadow rendering technique...

I was initially under the impression each shadow cast was completely independent and rendered according to the light source and rather cool...

it would appear that instead every single shadow in the game is a pre-stenciled entity that just becomes darker (or lighter or does not appear) depending on the light-source angle and the intensity of the light-source...
I had to jump in here as a programmer to say that you are incorrect. Doom 3's stencil shadows are fully dynamic, fully 3D, and conform to the environment as they should.

What you are seeing (and complaining about) is the result of the light source (flashlight) being very close to the your eye (the camera). If it were exactly at the point of the camera, you would see no shadows at all. As the light source and the camera move away from eachother in 3D space, the projection of the shadow onto the 2D screen (your monitor) will become more distinct from the projection of the shadow caster. Because the light source and eye are at nearly the same spot, so the projections are nearly the same and you get the flat appearance of the shadow. The same thing would happen in real life! Try putting a flashlight by your eye in an otherwise pitch black room and see how the shadows look.

Another way to see that the shadows are correct was mentioned above: look at the shadows cast by another player's flashlight, or set your in-game camera to be behind and above your character....I seem to remember a post here explaining how to do that. Then you will be able to see the shadows wrapping around the environment like you want.

I've implemented stencil shadows before, and it would be far more difficult to have them floating out in space like you are suggesting than to do them correctly.
Zeno is offline   Reply With Quote