Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Zoost

Question about shadows

Recommended Posts

Hi,

I noticed that in other games that use character shadows the shadows are not pitch-black and hard-edged as in doom III. for example:

http://well-rounded.com/viewer.asp?ID=unreal2&sub=games&pn=04&name=unreal%202

To be honest I like these shadows more then the pitch-black and hard-edged shadows we saw in the high res screenshots in the bathroom scene.

Is there a implementation reason why Doom 3 uses the shadows they use?

Share this post


Link to post

The game is dark, atmospheric, the shadows in the Unreal II screenie wouldn't suit well in DOOM III and I like the pitch black hard edged DOOM III shadows more anyway :)

Remember that dynamic real time radiosity lighting is still years away from full implementation so that's also one of the reasons for the pitch black shadows that u saw in those high-res DOOM III screenshots.

A more technical explanation could be given by Zaldron when/if he checks this post.

Hope i helped u.

Share this post


Link to post

Shadows in Doom III are not pitch-black by definition. They were in the Bathroom scene because there's only one light source, and (as Dima pointed out) no indirect light to brighten things up. If you would put another light in the room however (by the urinals, for example), the shadows would not be totally black.

If you've got the leaked video, look at the pillar at the right when the Hell Knight first walks past. The shadows are hard-edged and perfectly visible, but only at 10% intensity or so. That's because there's plenty of light coming from somewhere else in the scene. Wish I could put up screenshots, though there's plenty of places in the Legacy vid where you can see the effect as well if you look close enough.

EDIT : Well okay, here's an example. As soon as the imp summons his great ball o' fire, he casts a shadow on the grate. And as you can clearly see, there's enough lights coming from the other lights in the scene that the shadow isn't black at all.

Share this post


Link to post

Hi. Lord Flathead and Dima are absolutely right-- it's just a matter of how many lights overlap.

As to the hard edges, on quick inspection, it looks like Unreal2 uses what is called shadow-mapping, which is different from the volumetric stencil shadows Doom3 uses. The main advantages of shadow mapping are a reletive independance from geometric complexity (though I guess this is less signifigant with vertex shaders, now), and most importantly soft edges and penumbra effects such as the shadow fading as it gets further from the object (emulates light turbulance or whatever). The main, big disadvantage of shadow mapping is that you need a LOT of texture space (like, 100's of megs) to shadow everything uniformly. You can scale this down, but the shadow quality degrades rapidly. Also, it's hard to get self-shadowing using this techique. This could change in the future as the hardware becomes stronger, but right now Carmack did the Right Thing.

Share this post


Link to post

I like stencil shadows more than shadow maps. Shadow maps are icky. Stencil shadows are more correct, I think.

It's just hard to emulate a non-point light (eg: flourescent light)..

Share this post


Link to post

Aha, thanks guys, I have no idea what i'm talking off, bit if you can indicate that a pixel should be coloured black, why can't you indicate that it should be the original colour, but then (a bit) darker?

Well i guess I'm not graphic literate enough to understand ;-)

Share this post


Link to post

Lighting is calculated (summed) before the beauty pass (which adds the material colors). And since they are going for a dark atmospheric game, no ambient light term is being used. Though I believe they could use a non zero ambient if they wanted too. Quake 4 wouldn't look right being all dark like DOOM III.

Share this post


Link to post
Zoost said:

Aha, thanks guys, I have no idea what i'm talking off, bit if you can indicate that a pixel should be coloured black, why can't you indicate that it should be the original colour, but then (a bit) darker?

Well i guess I'm not graphic literate enough to understand ;-)



You need to picture the mechanics of lighting in your head. Picture your room, sealed off from all external light sources..

Now imagine a light just floating in the middle, and it turns on.

Everywhere a part of a surface is hidden from the light (facing away or behind something) there is no other light source to illuminate that surface.

The ONLY way it can be illuminated at all is because of radiosity (light bouncing off everything).

But that's too expensive.

In generic laymen's terms, Doom3 runs through each light and determines where the light gets blocked and doesn't illuminate something, then it draws what the surface would look like illuminated by that light except it cuts out all the areas where the light was blocked.

This is done until all the lights have been used to illuminate a scene. Some lights can illuminate the shadows formed by other lights, but if there is only 1 light, what's going to illuminate the shadows it forms?

Does it make sense yet?

Share this post


Link to post
GiXeLz said:

You need to picture the mechanics of lighting in your head. Picture your room, sealed off from all external light sources..

Now imagine a light just floating in the middle, and it turns on.

Everywhere a part of a surface is hidden from the light (facing away or behind something) there is no other light source to illuminate that surface...

BLABLABLABLABLAAA...

Does it make sense yet?

Actually, it does!
Thanks..

Share this post


Link to post

As I mentioned in another thread, if you have your bedroom with all external light sealed off and one single light bulb illuminating the room, the shadows will obviously not be pitch black.

Doom 3's shadows are pitch black and hard edged because of engine limitations. It's almost funny how limited the GeForce3+ cards are. Back in early 2001 when the GeForce3 video was released, it implied a video card that was capable of producing Toy Story quality renderings in real time. What a joke of an idea that turned out to be. But oh well, no big deal I suppose.

Share this post


Link to post
AndrewB said:

As I mentioned in another thread, if you have your bedroom with all external light sealed off and one single light bulb illuminating the room, the shadows will obviously not be pitch black.


which is why I said:

GiXeLz said:

The ONLY way it can be illuminated at all is because of radiosity (light bouncing off everything).

But that's too expensive.


If we remove radiosity, shadows WILL be pitch black. In Doom3, there is no radiosity, which is why scenes with 1 light source have pitch black shadows.

All we need to add is radiosity and the scene will be one step closer to real. But radiosity is too expensive to calculate realtime. So they don't..

Share this post


Link to post

I understand the one light and radiosity stuff, but that still leaves my question open?

Zoost said:

but if you can indicate that a pixel should be coloured black, why can't you indicate that it should be the original colour, but then (a bit) darker?


Or is this thought too simple?

Share this post


Link to post

Because... They want to make it pitch black, so that they don't have to render anything in the shadowed area. If they just made it darker, then they'd have to render everything cast under the shadows and then make it darker, which might not be a big deal, but you have to realize that John Carmack is a performance freak. He'll make sacrifices like these so that more framerate power is freed up for other eye candy.

Again, if it's pitch black, all the engine has to draw where the shadows exist are black stencils. However, in areas with more than one light source, you WILL see shadows that are not completely black. Otherwise, it would look ridiculous.

Share this post


Link to post
AndrewB said:

Back in early 2001 when the GeForce3 video was released, it implied a video card that was capable of producing Toy Story quality renderings in real time. What a joke of an idea that turned out to be. But oh well, no big deal I suppose.

Actually they were right. Pixar used a renderer called Renderman that does NOT support radiosity of any kind. What you see in that movie is an excellent use of simple, point lights to simulate photorealistic lightning. It's not that hard really, there are tons of tutorials to get at least a decent illumination out there.

Share this post


Link to post

They also mentioned Toy Story 2 and A Bug's Life. Would the GeForce3 or even GeForce4 be capable of rendering A Bug's Life in real time?

Share this post


Link to post
AndrewB said:

They also mentioned Toy Story 2 and A Bug's Life. Would the GeForce3 or even GeForce4 be capable of rendering A Bug's Life in real time?



Why would you want A Bug's Life rendered in real time?

Share this post


Link to post

So you could turn it into an FPS :-)

ps That's really interesting about not having to render anything in the pitch black shadows. I didn't realize this was being done.

Share this post


Link to post
Smokebox said:

Why would you want A Bug's Life rendered in real time?

If you think that has anything to do with anything then you are a qualified potato chip.

Share this post


Link to post
Zoost said:

but if you can indicate that a pixel should be coloured black, why can't you indicate that it should be the original colour, but then (a bit) darker?



Here: http://www.van-noland.com/gixelz/howitworks.psd

A 2 megabyte .psd explaining how the lighting works. Each layer is one pass ahead of the layer above it. It runs progressively downward so you can just hide the layers from top to bottom to see.

To make the pixel lighter would be incorrect. Radiosity would have to make the light brighter. This is one of those situations where you wonder why does it matter. Like why does it matter if the stencil shadows in Doom3 don't match truform. It would still work, but it's wrong.

Your idea of just making it brighter is called ambient light. Ambient light is faking radiosity.

Share this post


Link to post
GiXeLz said:

but it's wrong.


Is there a law against it?

Thanx for the info, I hope it will help me understand it.

Share this post


Link to post
GiXeLz said:

Your idea of just making it brighter is called ambient light. Ambient light is faking radiosity.

And all artists absolutely hate ambient light. It's downright useless unless you're using it for a 3% increase or something like that. Directional lights are far better ways of faking radiosity.

Share this post


Link to post
AndrewB said:

Because... They want to make it pitch black, so that they don't have to render anything in the shadowed area. If they just made it darker, then they'd have to render everything cast under the shadows and then make it darker, which might not be a big deal, but you have to realize that John Carmack is a performance freak. He'll make sacrifices like these so that more framerate power is freed up for other eye candy.

Heh no, I think you're wrong there.

And even if you dont draw anything there, you still have to draw all black to fill in the gap - remember in doom if you walk through walls you get the hall of mirrors effect? That happens because the rendering from the previous frame isnt overwritten with anything.

Share this post


Link to post

drawing all black is thousands of times easier thatn drawing textures...

Share this post


Link to post

the engine is still drawing stuff, you just cant see it

with the all black shadows the engine does almost nothing

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
×