Jump to content
The Dark Mod Forums

The Great Ambient Light Hoedown


nbohr1more

Recommended Posts

Since I have more forum time than experiment time, I thought I would pose a couple of questions about lights with the AmbientLight keyword applied to them. When I first broached the subject, it was to understand Lunaran's "Strombine" map. I took his liberal use of Ambient Lighting to mean that these lights have much lower performance impact than standard lighting.

 

What we know about Ambient Lights:

 

(According to Modwiki)

 

ambient (meaning no shadows, bumpmapping or directionality)

 

Now if we add our special Ambient_World to the mix:

 

1) Rebb's fix locates where ambient lighting should be applied

2) Either a simple brighten blend is baked into the materials at map load based on this detection

3) Or a more detailed blend which include normal mapping is baked

 

So if we gather the above detail, we can presume that any other ambient lights will be detected and applied with the same process. Once detected, these should be baked into the ambient stage as well. Potentially meaning that an nearly unlimited number of ambient lights can be overlapped without the normal light performance penalty because they are all baked-down at map load?

 

 

So, have any mappers tried overlapping numerous Ambient Lights?

 

If this has been done, how was the performance compared to regular lights?

 

How does a scene with lots of Ambient Lights compare to one with lots of grime decals?

 

If the performance is acceptable, the why aren't more mappers using lots of small ambient lights for subtle radiance effects?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Ambient lights are not baked into a light map or otherwise combined into one rendering operation. They are processed individually like all other lights. Performance is slightly better because you sacrifice specular reflections and shadows but since the ability to disable specularity and shadows is not exclusive to ambient lights, they are really no better for performance than point lights with the same settings. It's the lack of specularity and shadows that makes Strombine perform well.

 

Decals add detail and variety to the underlying textures. With decals you can cover up the fact that you're only using a handful of standard textures throughout the map. Fewer textures means fewer drawcalls since the render splits everything into passes based on entity, light, and texture count.

 

The lesson to pick up from Lunaran's work is that people who have a very comprehensive understanding of the engine can produce custom content that looks and performs very well. It's not ambient lights or an abundance of decals that makes the difference. It's simply knowing what you're doing.

Link to comment
Share on other sites

If you want a light with almost no performance impact (compared to other lights), try looking at blend lights. They are basically "3D decals" that fill a light volume instead of being applied as a planar surface. Potentially a powerful tool, but I don't think they get used very much.

Link to comment
Share on other sites

my illusionists tower uses two ambient world lights, one for the above surface light and one for underground light, but they don't overlap, they butt up against each other, although someone said you shouldn't use more than one ambient world per map the game doesn't like it, although I did read in the wiki that multiple ambient lights could be used to create different ambient light colors depending on the mood of the part of the map it was used in so am not actually sure if you can use more the one ambient world light.

Link to comment
Share on other sites

Ambient Lights have a very similar cost as standard lights in Doom3, because they all run through interaction.vfp.

 

You can have multiple ones to fake local radiosity effects, but - as with standard lights - it's better not to overlap them too much.

 

It would actually be interesting to see some maps try carefully placed localized ambients instead of world ambient on everything.

Link to comment
Share on other sites

It would actually be interesting to see some maps try carefully placed localized ambients instead of the world ambient on everything -

 

That would break the simple and enhanced ambient settings.

 

We can already achieve something similar though with tels location based ambient system.

 

1. Place the ambient_world across the whole map.

2. Setup location based ambients in different rooms / sections of the map.

 

This will automatically adjust the ambient_world on the fly. No need for additional lights.

Link to comment
Share on other sites

That would break the simple and enhanced ambient settings.

 

Setting the world-ambient to full black causes the material-based approach to be skipped completely afaik.

The actual light-based world-ambient mode would need a small code adjustment tho, so it disables the whole thing when set to black.

 

Even without that tho, if its set to fully black, it should contribute no shading, unless theres something weird being done in the shaders ( altho currently still some performance impact in the light-based world-ambient mode ).

 

The additional ambients would just be drawn normally.

Link to comment
Share on other sites

Now if we add our special Ambient_World to the mix:1) Rebb's fix locates where ambient lighting should be applied

 

Rebb's fix corrected the broken shadows, it didn't have anything to do with the ambient_world, that's a completely separate system.

 

2) Either a simple brighten blend is baked into the materials at map load based on this detection 3) Or a more detailed blend which include normal mapping is baked So if we gather the above detail.

 

There is no baking involved in this process. Where are you finding this information? When using 'simple' or 'enhanced' ambient settings in the menu, the game will read the levels of the ambient_world light and pass them to the material files of all the textures. This does a blend stage to brighten the texture by the same values in the ambient_world.

 

we can presume that any other ambient lights will be detected and applied with the same process. Once detected, these should be baked into the ambient stage as well. Potentially meaning that an nearly unlimited number of ambient lights can be overlapped without the normal light performance penalty because they are all baked-down at map load?

 

This is not how it works. Only the ambient_world is detected and all other ambient lights are treated normally. Again, no baking is done, so this wouldn't work.

 

So, have any mappers tried overlapping numerous Ambient Lights?If this has been done, how was the performance compared to regular lights?How does a scene with lots of Ambient Lights compare to one with lots of grime decals?If the performance is acceptable, the why aren't more mappers using lots of small ambient lights for subtle radiance effects?

 

Because it doesn't work the way you're describing. :)

 

 

my illusionists tower uses two ambient world lights, one for the above surface light and one for underground light, but they don't overlap, they butt up against each other, although someone said you shouldn't use more than one ambient world per map the game doesn't like it, although I did read in the wiki that multiple ambient lights could be used to create different ambient light colors depending on the mood of the part of the map it was used in so am not actually sure if you can use more the one ambient world light.

 

So, if you have two ambient_worlds butted up against each other, only one ambient_world is recognized. Now, with ambient lighting set to normal in the menu, this is fine...the two lights will function normally...but...

post-3-130209126047_thumb.jpg

 

If you turn on 'simple' or 'enhanced' ambient...then your first ambient_world is applied to the entire level. What this means is that any area covered by your second ambient light is going to be twice as bright as you intended, because the simple / enhanced ambient settings apply the ambient_world to the entire level, hence why it is called the 'ambient_world'. ;)

 

As seen here.

 

post-3-130209127445_thumb.jpg

 

The correct way to do what you were attempting would be to spread your ambient_world across the entire level, but then setup a location based ambient light that would automatically adjust the ambient_world to the settings you desired for that area. With the location settings, you can change the lighting to any value you want and it works with all of the ambient menu settings.

 

 

 

Another bad practice I have seen is mappers only putting the ambient_world over half of the map. So when a player uses the 'normal' ambient setting (meaning only the physical light is read) half of the map is in darkness....but when 'simple' and 'enhanced'(material stage lighting) are used, the map is correctly lit.

 

post-3-130209128752_thumb.jpg

 

 

I'm going to have to go over the wiki entries about ambient_world lighting to make sure the information is correct. There was a lot of confusion in this thread, and that is somewhat alarming.

Link to comment
Share on other sites

Well that settles it.

 

I was hoping that people less mechanically precise than Lunaran could pull-off something close to his look by applying gobs of subtle ambient lights. Instead we are left with "you need to be just as razor-sharp precise as Lunaran to pull that off". I guess the only magic there is conservation of texture use which would give you a little more performance head-room to add more lights but not much. So great art-style, precision, and technical knowledge...

there is no trick to make it easy.

 

 

BTW blendlights can be isolated to specific materials via the spectrum keyword just like regular lights... correct?

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

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

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • 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 )
      · 3 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
       
      · 7 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
×
×
  • Create New...