Jump to content
The Dark Mod Forums

Baked Global Illumination in Doom 3


STiFU

Recommended Posts

I ran over a nice tutorial today explaining how to bake Global Illumination into a lightmap and using it afterwards in Doom 3(screenshots included). What do you think? Could it be put to some use in TDM in combination with Doom's shadow volumes?

 

I think it would make some places look a lot more vibrant and especially bigger areas would profit from it by looking less monotone. The process of achieving this effect seems to be pretty extensive though and I am not sure how well it would behave together with dynamic lights and the ambientlight...

 

There is also the question of consistency. Rendering the Lightmaps for a whole level would be way too much work, as far as I can tell from the tutorial, so you'd have some places with "realistic" lighting in your map and some with the standard lighting.

Edited by STiFU
Link to comment
Share on other sites

Yeah, probably would work. But, it looks like a lot of effort, and the baked part of the lighting wouldn't affect the lightgem (the direct part would though, since that part is done with a real in-game light).

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Wow, that could subtly make some AWESOME scenes, like a dimly lit crypt with a bright sunbeam coming in from a hole in the mountain. The dim areas could be dim enough to just be ambient looking and not affect the light gem with no "wtf" effect on the player, and the light beam itself could be realtime.

shadowdark50.gif keep50.gif
Link to comment
Share on other sites

The screens in the tutorial look familiar. I think I saw it on D3W first. While it looks beautiful the part with not affecting the light gem kills it for Darkmod.

 

...raising my hand again for hand-painted light-textures: I'm still very fascinated by what some guy called Matt Breit achieved in a Quake-4-Map (Strombine) by PAINTING light textures according to the geometry.

 

Check it out here, at least the screenies.

 

I tried it myself in a testmap but my only result was that you actually need skills to make it look good...

 

-_-

Link to comment
Share on other sites

The screens in the tutorial look familiar. I think I saw it on D3W first. While it looks beautiful the part with not affecting the light gem kills it for Darkmod.

Yeah, it does kind of, but I guess it would be worth an experiment. If you set it up wisely in a fashion like Komag suggested, it might work. Although, I think the ambient level also affects the lightgem (I remember reading something like that about raising the ambient level in The Outpost). Anyway those lightmaps could still be applied to places the player isn't going to reach, like a ceiling or a statue (uhh GI's on statue, that'd be sweet). It would, like I said, created some more diversification on distant walls/ceilings.

 

By the end of the year I'll have some free time again. I will probably experiment with this a little then, if nobody else has done it yet. But feel free to do!! I am anxious to see some screens.

Edited by STiFU
Link to comment
Share on other sites

I'm at work and have been pouring over forums and Wikis looking for this for awhile so I'm gonna paste it here:

 

// Multiply lightingmap by any color behind this surface on the screen.

{

blend modulate

map textures/ptec/lightingmap

}

}

 

I'm gonna work on an AO pass overlay for models that use stock tex (ie:no baked ambient-or handpainted for that matter).

-------------------

 

While it does look cool, notice he mentions Death Match maps. Basically really small maps that could be made in a 3d program. No way I'd want to model (and try to optimize) even any of the small released maps. It really would require having a full model of the entire FM- or important areas (ie: full rooms). Doubling the polys even without shadow recieving/casting on them.

 

I do think there might be a way this could work and be easier.

 

Is it possible to open a lightmap for a dmapped map? Can we extract that from the map and replace it?

 

If so, the thing to do would be compile your map. extract the lightmap(s).

Take a copy of the map (probably with no objects, just terrain) and apply a light grey tex to everything. position alot of lights throughout all passageways to light everyhitng up to a white color while leaving nice dark spots in all corners.

Compile that and extract that lightmap.

Take both lightmaps into Photoshop and multiply the AO on top of the regular lightmap.

 

This might be a good way to add AO to the lightmaps without 3d editor and get good overall ambient to kill harsh shadows, while at the same time darkening corners ADN getting rid of the world ambient and one less light on all polys.

-------

 

So if anyone knows how I can extract a lightmap from a compiled map please let me know.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

It should affect the lightgem shouldn't it? After all the lighting would just be a larger no-shadow shader would it not? And shaders affect the gem.

 

If it was not to affect the light gem them you could always place lights floating in the air not touching any walls or floors (making them invisible) to simulate the light.

Link to comment
Share on other sites

It should affect the lightgem shouldn't it? After all the lighting would just be a larger no-shadow shader would it not? And shaders affect the gem.

 

If it was not to affect the light gem them you could always place lights floating in the air not touching any walls or floors (making them invisible) to simulate the light.

 

The point of Ao is not to 'light airspace' and having lights that don't touch any walls wouldn't be seen. If they touch walls they add to the count of lights touching polies which decreases performance. They would also effect the light gem anytime the player box passed through them.

 

I do believe the world ambient light has NO effect on the lightgem. That was the purpose of it, to increase gamma only. Gamma doesn't effect the lightgem.

 

Baking an additional AO for a map would get rid of the need (possibly) for the world ambient gamma light. But most importantly would just help shade corners and make textures appear to tile less and make them look a bit dirtier in a mission specific way. And if maunally combined with the compiled lightmap (ie not overlayed in game) would have no effect on performance.

----------------

I looked into this a bit more.

 

Unfortunately the ONLY way to do it is with models. But rather than using light sources like in that tut using an Ambient Occlusion generator (XNormal is free beta right now).

 

Doom 3 doesn't use baked lightmaps.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I do believe the world ambient light has NO effect on the lightgem. That was the purpose of it, to increase gamma only. Gamma doesn't effect the lightgem.

 

Baking an additional AO for a map would get rid of the need (possibly) for the world ambient gamma light. But most importantly would just help shade corners and make textures appear to tile less and make them look a bit dirtier in a mission specific way.

HappyCheeze and NH beg to differ. According to them, the ambient light affects the light gem, but as you said, AO can still be used selectively to get a more realistic overall impression and diversification.

Link to comment
Share on other sites

So if anyone knows how I can extract a lightmap from a compiled map please let me know.

As you discovered, this isn't possible, because there are no lightmaps to extract. All Doom 3 lighting in performed in real time. That was kinda the point of the whole "dynamic, unified lighting/shadowing" malarky. :)

 

It should affect the lightgem shouldn't it? After all the lighting would just be a larger no-shadow shader would it not?

No, it wouldn't. It's just an extra pass on the level geometry. As the guy mentions in his tutorial, this baked lighting technique explicitly only applies to level geometry, and does not affect players and other moving objects in the world. (That's why you need to keep the direct lighting as actual in-game lights, so that at least some of the light has an effect on moving objects.) The lightgem model, from which light values are read, is a moving object under that definition; so it isn't affected.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

I might be wrong on this as i haven't looked at the source myself, but doesnt the lightgem use some sort of small scale cubemap render of the surrounding area ? In this case it would pick up any shading around it, including baked lighting on map geometry

 

Edit : Or was it an "inverted" cubemap render of only the lightgem model ? In that case it wouldn't i guess.

Link to comment
Share on other sites

Yes, the lightgem renders are directed inward, not outwards, so it doesn't take the environment into account. It's not a cubemap exactly, but kind of a similar idea; it's two square pyramids stacked on top of each other. Bottom pyramid points down, top one points up. There are two renders, one from below and one from above.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Ambient/Projected lights with custom textures are the way to go if you want to maintain light gem functionality. The map plasticman linked to at the start of this topic is perhaps the best example I've seen in any id Tech 4 game.

 

Lunaran, the author of said map, elaborated on the process he used here for those who are curious.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...