Jump to content
  • Advertisement
Sign in to follow this  
redeemer90

How does the doom3 engine render soo many lights

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was just wondering how the Doom3 engine renders so many lights in a single frame with bump mapping and specular highlightting. Ok, lets take my card -> ATI Radeon 8500. It has 8 texture stages. So 3 texture stages will be used for diffuse mapping, normal map and 1 for the specular map. Then each light will use texture stage for the light normal and 1 texture stage for the half angle vector for specular mapping. I created a doom3 map with 5 lights touching a single face and all the lights were rendered perfectly ok. The only way I can think that this is hapenning is if Doom3 does multiple passes per frame. So my question is -> Does it? and if so, how does it manage to keep up such a decent frame rate? I am very curious as to how Doom3 manages this. Thanks, - Sid

Share this post


Link to post
Share on other sites
Advertisement
Why would you need a texture stage for light normal and specular half vector? Right now I just use a uniform constant for the light normal, and calculate the half in the shader. Since specular is view-dependent, when doing per-pixel lighting you have to calculate the half vector in the pixel shader anyway.

Anyhow, I have read some lighting tricks in shader books that show how do to 4 lights per pass. I imagine it's something like this.

Share this post


Link to post
Share on other sites
doom3 does take multiple passes per frame, in fact if i remember right it takes an extra pass or two -- per light.

Share this post


Link to post
Share on other sites
Quote:
Original post by ace_lovegrove
Shame it still looks horrible though.


nah, it looks fine, it is just so damn dark you can't see any of the greatness. That and the gameplay sucked...

Share this post


Link to post
Share on other sites
The key thing to remember about Doom 3 is that very few of the lights overlap each other much. The engine is designed so that during each light pass only the polygons that are affected by that light are drawn, so in essence if a poly is only being hit by one lights it only takes one pass to draw. (Well, yeah, there's multiple passes for specular and such, but you get the idea)

Therefore, while it sounds like you're redrawing the entire scene 3-4 times per light, you're mostly drawing the scene 3-4 times total, with certain polys drawing a bit more due to light overlap. Using that logic, it almost becomes cheaper to fill a room with 50+ non-overlapping lights rather than use 3-4 big overlapping ones.

//Slightly unrelated rant

Oh, and stop complaining about how bad Doom looks. It looks great, especially considering the hardware it runs on, and you know it. I hate people who bash game X because it's the "fashionable" thing to do. It's a good, solid engine that if nothing else is slightly behind it's time. In any case, I have much more appreciation for the D3 engine than something like HL2.

(Now the gameplay... that's a different ball of wax all together. ^_^)

Share this post


Link to post
Share on other sites
graphically doom3 is still the most advanced game that exists as of today on the pc
if anyone has a differeing opinion ild like to see links to a demo

Share this post


Link to post
Share on other sites
Quote:
Original post by skittleo
But all three of those games are top notch.

Agreed, and I say we leave it at that.

Share this post


Link to post
Share on other sites
Quote:
How can you compare Doom 3 and HL2 and Far Cry? They take place in wildly different environments! Now on a realism scale, I would vote for HL2 because it takes place in settings so familiar to us. But all three of those games are top notch

whilst this is true (though ild say farcry would be the most realistic, ie when was the last time u saw aliens towering over your town)
doom3 is the only one of the 3 games mentioned that features realtime shadows

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!