Icon of Sin / Baphomet
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Newfangled Doom > Doom 3 General > Questions about how Doom 3 handles shadows
 
Author
All times are GMT. The time now is 13:01. Post New Thread    Post A Reply
GoatLord
I really should think before I post.


Posts: 2307
Registered: 07-02


1) Why wasn't EVERY surface in the game shadowed? Several areas in the game lack shadows, and at no point do you see shadows projected from the player or weapon pickups. I assume this was done to keep the framerate decent.

2) How do multiple light sources affect shadows? A few times in the game, I saw two shadows being projected at once, but if there are a large number of light sources in a given area, one should logically see a large number of shadows of varying luminance values. I assume there's a limit to how many shadows can be projected from a given surface.

3) There are a few points in the game that feature shadows with penumbras. Is there some sort of option in the editor that determines which shadows are stencil shaded, and which ones are shadow maps? Could the entire game's geometry potentially use the shadow map method?

4) I understand that stencil shadowing was a computationally efficient way of producing semi-realistic shadows, but I've noticed that some of the shadows aren't pitch black. What accounts for this and why couldn't all of the shadows be of various luminance values?

5) If you look at the fourth screenshot of in the "Doom 3: Phobos" thread (http://www.doomworld.com/vb/doom-3-...-doom-3-phobos/), you can clearly see the player holding a shotgun, which has been colored blue from the lighting. However, the darkest areas are no darker than the blue of the light; is the engine not capable of producing the darker and ultimately black shades one would expect to see in such lighting?

Old Post 11-18-13 23:35 #
GoatLord is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5757
Registered: 08-00


I'm not sure if anybody but Carmack himself could answer these. The fact you know to ask them in the first place means you already know more about it than me, at least >__>

Old Post 11-19-13 04:48 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Shaviro
Team Future Chief


Posts: 8753
Registered: 06-00


1) Like you guessed, it's a performance issue. Some areas are given lights that do not cast shadows. Some materials are also set to not cast shadows.

2) The shadows depend on several things. Is the material a shadow caster? Is the light? Is the light big enough to contain both the caster and the geometry to cast against? Some of the lights are undoubtedly set to not cast shadows. Performance is heavily dependent on how much shadow-geometry (in reality it's light geometry, the shadows are what does not get rendered) there is in a scene.

3) That is whenever a texture is applied to the light. It doesn't cast soft shadows, it just projects a picture onto the geometry. Usually to simulate light coming from behind grates, fans or flickering light.

4) Whenever a shadow isn't pitch black, it's because another light is hitting the surface. This would usually be to avoid having pitch black corners, so you put in a fill-light with a low light level and disable shadows on it.

5) The engine is very capable of producing dark or black shades. Getting it to not do this is the hard part. Pitch black is the default :)

Old Post 11-19-13 07:15 #
Shaviro is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Da Werecat
Forum Regular


Posts: 885
Registered: 11-09


I'll add a few cents.

1) Seeing your own shadow is pretty cool... until you look down.

3) Some shadows are made with decals. They're usually being "cast" by hoses hanging in front of walls, I don't remember any other examples.

5) Fog.

Last edited by Da Werecat on 11-19-13 at 21:05

Old Post 11-19-13 10:37 #
Da Werecat is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
FireFish
Junior Member


Posts: 114
Registered: 04-13


i looked at the light related source code at multiple times to figure out a way to "force expand it", so i will take a throw at this.
do not take my answers as an absolute truth, i did not look at everything light related and i might be wrong at some points.

1) the engine seems to load the map in an pitch black unlit condition. then it starts to add the lights, and calculate the rendering list for them. the pitch black areas in the map never seems to be touched by a light. then the source code contains calculations which check if the model surfaces are defined as being capable of receiving or casting shadows. many of those routines are programmed in a way to skip unnecessary calculations.


2) the engine seems to calculate shadows based on the closest light touching it. but this might be something i need to read again in the code to fully understand this system, but at the moment i read the code as ; " shader / object has already been added to the shadowcaster list, will not be added multiple times"

3) the engine its code for stencil shadows is complex, my best bet on remembering it is that it is somewhat hardcoded.

4) for this i need to read the code in a way more efficient manner.

5) one light is orange of nature, and casts orange lighting on its surrounding, and i suspect the strong blue light is casting an additive hue over the surrounding area or there is some kind of fog changing the way the render is made, cancelling out the pitch black.

Old Post 11-20-13 19:36 #
FireFish is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
GoatLord
I really should think before I post.


Posts: 2307
Registered: 07-02


Thanks for the replies, this has been really fascinating. One quip: Firefish, I don't quite understand your answer to question 3.

Old Post 11-21-13 00:32 #
GoatLord is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
FireFish
Junior Member


Posts: 114
Registered: 04-13


part 3 is all about the stencil shadows, which is a complex piece of code that i did not read enough to understand it 'better'.

Old Post 11-21-13 10:32 #
FireFish is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Da Werecat
Forum Regular


Posts: 885
Registered: 11-09


Well, the answer is quite simple and doesn't require looking into the source code: there aren't any "true" soft shadows in Doom 3.

Old Post 11-21-13 11:19 #
Da Werecat is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Shaviro
Team Future Chief


Posts: 8753
Registered: 06-00



Da Werecat said:
Well, the answer is quite simple and doesn't require looking into the source code: there aren't any "true" soft shadows in Doom 3.


Pretty much. Any of the soft looking shadows are in reality a grayscale texture that ends up being a value from 0.0 to 1.0 that they in the pixelshader use to multiply the resulting color of all the other operations.

Old Post 11-21-13 14:29 #
Shaviro is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 13:01. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Newfangled Doom > Doom 3 General > Questions about how Doom 3 handles shadows

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Message Board Statistics