Jump to content


Photo

Ambient Occlusion & Bounce Lighting

rendering graphics visual ssao radiosity opengl feature occlusion

  • Please log in to reply
16 replies to this topic

#1 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 703 posts

Posted 07 June 2016 - 01:21 PM

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



#2 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8866 posts

Posted 07 June 2016 - 01:34 PM

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.c...ds/the-dark-mod

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

#3 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 703 posts

Posted 07 June 2016 - 02:32 PM

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!



#4 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5608 posts

Posted 08 June 2016 - 02:22 AM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#5 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5380 posts

Posted 08 June 2016 - 03:26 AM

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.)


Posted Image

#6 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8866 posts

Posted 08 June 2016 - 05:45 AM

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.c...ds/the-dark-mod

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

#7 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 703 posts

Posted 08 June 2016 - 06:27 AM

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 :)



#8 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1799 posts

Posted 08 June 2016 - 06:43 AM

You can test a brilliant AO/IL-problem solution with ReShare 2.03 (reshade32.dll -> opengl32.dll) and this shader: http://reshade.me/fo...il?limitstart=0

 

It's working in TDM 2.04 too.


Edited by lowenz, 08 June 2016 - 06:45 AM.

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.


#9 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 466 posts

Posted 08 June 2016 - 07:54 AM

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.thedarkm...iew.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, 08 June 2016 - 08:35 AM.

  • STiFU likes this

My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#10 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8866 posts

Posted 08 June 2016 - 08:08 AM

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.c...ds/the-dark-mod

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

#11 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1799 posts

Posted 09 June 2016 - 12:50 AM

 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, 09 June 2016 - 12:52 AM.

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.


#12 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 466 posts

Posted 09 June 2016 - 07:09 AM

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!


#13 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 703 posts

Posted 09 June 2016 - 07:20 AM

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 :)



#14 Arcturus

Arcturus

    Advanced Member

  • Development Role
  • PipPipPip
  • 1624 posts

Posted 09 June 2016 - 11:54 AM

Blender developers plan to switch to OpenGL 3.2 for the viewport in ver 2.8. It will most likely also replace old internal renderer.


It's only a model... /// My channel on YouTube /// CGtrader , Turbosquid


#15 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1799 posts

Posted 13 January 2018 - 11:03 AM

Up!

 

https://reshade.me/f...th-il?start=400

 

https://pastebin.com/Btyfrq2U


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.


#16 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6192 posts

Posted 19 January 2018 - 08:24 PM

I can't get it to work right in SVN/2.06.

Does it work with 2.05?


I always assumed I'd taste like boot leather.

 

#17 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1799 posts

Posted 20 January 2018 - 06:03 AM

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


Edited by lowenz, 20 January 2018 - 06:03 AM.

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.






Also tagged with one or more of these keywords: rendering, graphics, visual, ssao, radiosity, opengl, feature, occlusion

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users