Jump to content
The Dark Mod Forums

Ambient Occlusion & Bounce Lighting


MirceaKitsune
 Share

Recommended Posts

As most players will surely agree, one of the things that make TDM great are its visual capabilities, which come from idTech 4 having been so well designed. As I've been playing more with rendering and game engines during the last period, I realized this is something worth bringing up in the graphics department. I dare suggest it since frankly, TDM has some of the best graphics in the world of open-source games today... the idea of adding a common effect that would rocket its visual quality even higher sounds acceptable enough to post about.

 

Typically there are two light occlusion effects, though I can imagine them combined in one by a smart renderer: Ambient Occlusion to simulate darkening in tight spaces, and Global Illumination to simulate light reflecting off surfaces. They're often costly to calculate for realtime lights, but there are engines that do it right... Tesseract (FPS based on Cube 2) offers a great example of doing FPS-cheap GI! A more serious problem specific to TDM is that this would affect the brightness of areas, and in turn the gameplay on existing maps... it would need to be an user option for this reason.

 

I'm mostly curious on the opinions of the devs; Could at least SSAO be considered at some point, if not an implementation for radiosity? Some examples of why this is so awesome.

 

Radiosity_Comparison.jpg

Link to comment
Share on other sites

There have been many discussions on this...

 

That said, the "new" HDR-lite shader in 1.03 and higher added some bounce lighting courtesy of Maha-X's brilliant highlights mod. It's pretty localized but you

should notice it near fire-places and other bright light sources. A full-fledged radiosity solution would require something like Crytech light fields or lightmapping with probes (etc).

No small feat but something that might be there in the future.

 

Oh, and lest you believe you cannot achieve this look without an engine upgrade, let Lunaran prove you wrong:

 

http://lunaran.com/page.php?id=165

 

too bad it's so labor intensive...

 

SSAO? We already prototyped this in SVN with Sikkmod integration. Now that we have depth buffer access, it's possible to implement this without all the bugs and artifacts of that implementation.

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

Interesting... didn't notice the effect in fireplaces, though I never looked closely. For whole entities (model + light) this can be easily achieved by just texturing the light bounces.

 

But yeah, I was thinking of calculating bounces for models and lights placed independently. Doing this fully might be a challenge no one will take... since it would require the engine understanding light as a volume, rather than just a 3D projection of a 2D texture. Or some form of compact ray tracing, though doing that in realtime is a crazy idea.

 

SSAO is the most obvious and important effect though. I understand that in comparison, it's easy to do with the Z-buffer and shaders... so hopefully it can be achieved a lot more easily in comparison. If brightness based occlusion could account the colors or lights and textures though, that could perhaps fake bounces too as a bonus!

Link to comment
Share on other sites

As nbohr said we've experimented with SSAO from the sikkmod. My personal opinion on that matter is, that due to the fact that TDM missions are normally pretty dark, the effect isn't as strong as one might think in comparision to the performance impact. The radiosity effect looks nice, though. But it also looks implementation and performance intensive :(

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

The SSAO from sikkmod I remember seeing, all it did was made some corners of places even darker than usual and hard to see, not even in a pretty way (like a layer of dark grime would have done better). I don't think I saw a single case where it improved the look. I could only imagine it looking good for a really bright sun-lit room, but not any of our FMs I could think of. But most importantly, it had a big performance impact that didn't justify it. (In contrast, the soft shadows were great! They had less performance hit, and were totally worth it, even with the bit of buggy-ness. But maybe I shouldn't be mentioning it... I don't know their current status.)

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I think SSAO should be a mask layer for the lights or just the ambient light rather than a post process.

We could probably even get away with cheap Tangent Space AO in the ambient and be done with it.

But, as Dema spoke, most of the missions have good high contrast lighting so the effect doesn't do much.

I guess that's a chicken vs egg scenario since mappers are manually approximating AO either by light placement or grime decals

and the latter is probably the bigger motivator to have it.

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

I can see why SSAO would need to be tweaked carefully, especially considering TDM's already dark atmosphere. I believe it still has its place though, as it's an effect having to do with accurate light physics. SSAO exists during night time all the same, even if it's a small lamp lighting an area.

 

It should however be noted that SSAO can be used in two ways: Brightening or darkening. Usually it's used to darken tight spaces... however it can also be used to give an inaccurate but good looking simulation of light bounces, which if good enough could be used to replace fancy GI altogether!

 

Here's an idea that pops to mind which might look pretty good, though it's just to exemplify: Say you have a corner, and half of it is being lit by a lamp while the other half is covered in pitch blackness. The AO could darken the space in the area of the light, in order to to simulate occlusion... but also gradually lighten the dark corner outside the radius of the light, to simulate the light bouncing around (the exact reverse). Using SSAO intelligently to both darken bright areas and lighten dark areas near lights could achieve a good middle ground, by looking good and also not affecting the gameplay :)

Link to comment
Share on other sites

You can test a brilliant AO/IL-problem solution with ReShare 2.03 (reshade32.dll -> opengl32.dll) and this shader: http://reshade.me/forum/shader-presentation/1874-marty-mcfly-s-ambient-obscurance-mxao-with-il?limitstart=0

 

It's working in TDM 2.04 too.

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Indeed, I'm holding out hope for whenever a radiosity solution gets implemented since in my opinion it's the biggest thing missing in TDM (that's visible to the end user) as it stands. Faking bounced light with omni lights is limited and grime decals are still decals - they're extra drawcalls that can halve your FPS if there's enough of them.

 

http://bugs.thedarkmod.com/view.php?id=3881 nbohr1more has this on the tracker and I suggest you track it. Hell, the mention of spherical falloff itself is pretty important on its own, since our omni lights really can't handle textures and the like very well with their current 'cheese slice' falloff method. You can see it in every map that has one of those desk lamps with shades - it looks like nothing on vertical walls. Same reason why the cloudscroll light texture is practically unusable in outdoor scenes.

 

edit: I like messing with sweetFX type stuff, maybe I'll try that ReShade shader lownz and see what's what!

 

I cannot seem to find where opengl32.dll is supposed to be so I could replace it or something. just dragging reshade into the tdm folder doesn't seem to activate it.

Edited by Spooks
  • Like 1

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

Yeah, I've been hoping to have cubemap based lights for awhile. It's probably half my own fault for trying to figure out how to allow materials to

set user-defined ARB shaders for lights so they have parity with the way the overall material system works. The easiest way is just to hard-code light types

and that should work without problems. I'll fix my stupid attempts at this and provide a hard coded example when I get a chance.

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

just dragging reshade into the tdm folder doesn't seem to activate it.

Rename "ReShade32.dll" to "OpenGL32.dll" ! (and unpack MXAO zip in the TDM root folder)

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Ah, thank you. Unfortunately it seems my card doesn't support OpenGL 4.3 and I can't run Reshade. Weird as I managed to make it run on American Truck Sim, but that's probably because it's a DX game. Ah no matter, not relevant to the thread.

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

OpenGL 4.3 support is still kind of a luxury, I don't think the engine should require more than 3.x for years to come. Especially since Mesa just recently got support for 4.1... and yes, many of us do play high-end games on the free video drivers :)

Link to comment
Share on other sites

  • 1 year later...

There's a new version and it's working BUT r_useFBO=1 introduces some incompatibilities (a strange kind of ghosting).

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

  • 1 year later...

Any AO is better then nothing really.

 

The AO in this picture is only screenspace, you can see that the filter radius doesnt extend in the back.

We clearly need this <3

Of course is a form of SS-AO :P

Still we can ask Marty McFly to use it in TDM (adding FXAA on top as a cheap alternative to MSAA).

Edited by lowenz

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

Link to comment
Share on other sites

Not in that screenshot (it's only about the FPS tanking, RTSS can't capture the effect) take a look here ;) (downloading the original images)

 

Edited by lowenz
  • Like 1

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.

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.

 Share


  • Recent Status Updates

    • duzenko

      Please, can we finally group the missions by year in the game menu?
      · 3 replies
    • duzenko

      I vaguely recall someone recently complained about two-sided materials (curtains?) not getting lighting from both sides
      I just found a piece of code that's supposed to do just that
      Where was that discussed? (@nbohr1more?)
      · 8 replies
    • Xolvix

      I still play classic Doom (albeit with user-made mods and maps rather than the original campaign) on a regular basis. A game from the early 90's which has still got a healthy following in 2022. Pretty amazing.
      · 3 replies
    • Nort

      I'm beginning to understand why people who aren't into social clubbing "don't last long" on this project, and why it's so full of holes. When moderators are siding with bullies, by closing down threads that they derail, then I start to wonder if I should support the platform to begin with.
      I'm sure that the core development is solid, but when you're constantly tone policed and bullied, and moderators are playing into it too, then the project will just drive away talent, and replace it with socialites instead. ...and without talent, you only end up with a small skeleton crew trying to do everything themselves.
      ...so Dragofer and Airship Ballet, and all you other socialites, you win. From now on I'll just keep to myself. You'll never be able to do my work, but at least you'll be happy together, and that's what matters to you.
       
      Update
      Actually, I have to revise my statement:
      I actually messaged greebo - the top dog, I gather - about nbohr1more's outburst of insanity below, and since I haven't even heard back from him, I just have to assume that there's not a single core programmer here, who's not backing nbohr's threats. ...and that's bad.
      ...so if you're a newbie reading this, or an honest soul like ZergRush, then just slowly back out of these forums, run, and don't look back. This is nothing more than a cult posing as a game development project, using Thief and IDTech4 to sucker hopefuls in, to do work for them, while trying to cajole them into something going on behind the scenes, which apparently - according to nbohr - is something that should be hidden from the state. These people aren't programmers - they don't even understand things like how to fix the simplest bugs. All they have, is an engine, and an IP, and some sort of fascist social cult. There was some other project I saw being made in the Unreal Engine. Try joining that project. ...or start a project of your own. Anything but this asylum.
      Hopefully that was "divisive" enough for a final post, because at this point I really want people to leave this place. This project is, on a management level, just awful garbage, run by garbage people, apparently from the top down, and I'm just glad that they have a garbage place to stay, together, and hopefully forever.
      Nort
      · 9 replies
    • The Black Arrow  »  Araneidae

      A spidey! I love spideys 🕷️
      · 0 replies
×
×
  • Create New...