Jump to content
The Dark Mod Forums

Ambient Occlusion & Bounce Lighting


MirceaKitsune

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.


  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...