PDA

View Full Version : Doom 3 - light model?



03-20-2004, 04:35 AM
Hi gurus,

Recently I've been looking through screenshots for the upcoming Doom 3, and was just wondering how Carmack is getting such nice looking lighting effects:

Gorgeous diffuse lighting (http://www.planetdoom.com/images/image.asp?screenshots/official/24l.jpg)
On -the-fly specular highlights (http://www.planetdoom.com/images/image.asp?screenshots/hi-res-trailer/30a.jpg)
Multiple overlapping shadows (http://www.planetdoom.com/images/image.asp?screenshots/official/8l.jpg)
Projected textures from light sources (http://www.planetdoom.com/images/image.asp?screenshots/official/6l.jpg)
Self-occlusions (http://www.planetdoom.com/images/image.asp?screenshots/official/5l.jpg)

So how is he doing it? The projected shadows' geometry is too perfect to be anything other than calculated geometry, rendered via shadow volumes.

What about the diffuse lighting - surely that can't be using light maps? I can't see any obvious jagged edges to the lights - does this mean he is using very high-res luminance textures?

Specular reflections - surely he can't be geometrically calculating those on a per-frame basis as well?

Any thoughts, speculations (pun unintended) or links to similar discussions much appreciated!

Bob B.

zeckensack
03-20-2004, 05:44 AM
It has actually been discussed to death already http://www.opengl.org/discussion_boards/ubb/wink.gif
Browse this (http://www.webdog.org/cgi-bin/finger.plm?id=1) (note the "Archived updates" dropdown to the right).
The advanced forum seems to be down, unfortunately. We had some interesting threads on the subject.

Multiple overlapping shadows and self-shadowing are automatic feats of a good stencil shadow volume approach. Start with rendering all opaque geometry to the z buffer (ie leave the color buffer cleared to black), then
-produce volumes for *one* light
-accumulate contribution of this *one* light
-repeat for all lights

As I take it the volume geometry is calculated per frame, per light. To reduce workload, the polygon counts are kept pretty low. Some of the lost detail (from the original high-poly models) is reconstructed during the lighting phase with normal maps.

The rest is per-pixel lighting. That was one of the famous quotes from Macworld expo, every surface gets the same lighting equation, no more tricks, something along these lines.

One of your images obviously has a projected light map, but we can't really know for sure whether that will be used to any meaningful extent in the final version.

Jan
03-20-2004, 06:23 AM
Google for "per-pixel lighting", "bumpmapping" (or "normalmapping"), "specular lighting" and "stencil shadows". After reading the one billion papers you will find about that stuff, you will know everything you want to know.

Jan.

03-21-2004, 02:20 AM
Originally posted by zeckensack:
Browse this (http://www.webdog.org/cgi-bin/finger.plm?id=1) (note the "Archived updates" dropdown to the right).
The advanced forum seems to be down, unfortunately. We had some interesting threads on the subject.

Ah, that's a shame. I look forward to the advanced forum being fixed! http://www.opengl.org/discussion_boards/ubb/wink.gif

That's an excellent link, thanks.



Originally posted by zeckensack:
Multiple overlapping shadows and self-shadowing [...] The rest is per-pixel lighting. [...]

There must be some serious multi-pass rendering going on, then? Like 10-15 passes each frame!

When I hear "per-pixel lighting" it's usually in conjunction with pixel shaders, and I've thought no more about it. After a quick Google on the subject methinks I need to do some reading up on DOT3! I'd no idea this stuff was even possible in non-shader OpenGL.



Originally posted by zeckensack:
One of your images obviously has a projected light map, but we can't really know for sure whether that will be used to any meaningful extent in the final version.

Good point - these screenshots all need to be considered "work in progress". It'll be interesting to see what changes by release.



Originally posted by Jan2000:
After reading the one billion papers you will find about that stuff, you will know everything you want to know.

Ah, heh, better put the kettle on... http://www.opengl.org/discussion_boards/ubb/wink.gif