Marty McFly's Ambient Obscurance (MXAO) with IL

  • Martigen
More
6 years 2 weeks ago #601 by Martigen Replied by Martigen on topic Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly wrote: I'd like to keep SMAA talk outside the MXAO thread.

Hey Marty,

Sorry to raise this -- the above quote was in response to a discussion on the pages preceding that it turns out the SMAA shader doesn't honor Reshade's depth process flags -- so any buffer that needs to be reversed, logarithmic etc SMAA's depth technique isn't working properly.

At the time you (and maybe Crosire) said you'd take a look to add the appropriate code when you had a chance -- would you be able to do look at that now? As it stands we have a bugged SMAA shader. If I had any shader coding ability I'd fix this myself, but I don't :/
The following user(s) said Thank You: klotim
The topic has been locked.
  • Marty McFly
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #602 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Ok so I had a look at SMAA. Yes, it indeed grabs the unlinearized, unflipped, un-whatever raw depth buffer. Raw sauce, no ketchup. As far as I see, there are 2 options, each with their own (dis)advantages:
  • Add a prepass that creates a linearized depth buffer so all intrinsic SMAA calls read that one - just like it was in the ReShade framework. When porting it over to RSFX 3.0, crosire apparently made a mistake. This means 1 new pass and 1 new texture, so we have some more video mem usage but other than that, no big changes. Also very fast, as there's no need to linearize the depth data when sampling (can quickly build up when reading it a lot of times, MXAO does the same to prevent this).

  • Track down every place where original depth texture is read and patch it directly there so instead of just reading it, it's linearized directly after being sampled. This means huge code restructurements, as many functions are called with both color and depth texture, so when being called with depth texture, it needs a special treatment and so on. This would also place the linearization functions into SMAA directly as sometimes depth is gathered (4 neighbour pixels read with 1 call) and the ReShade linearize depth function in ReShade.fxh can't do that. Meaning that every future change to the linearization functions would require changing them in SMAA as well. TL;DR: chaotic code changes, hard to do, hard to maintain, 100x depth samples = 100x linearize math (performance costy), easy on video memory as it needs no new pass.

I think you already guessed it, I opted for the first one. I'm writing this so you don't think I was just being lazy - option 2) is very inferior in almost all accounts.

I haven't tested it in-depth but it should work, at first glance:

www.mediafire.com/file/3tbsjt3jcazy13b/SMAAFixedDepth.7z
Last edit: 6 years 2 weeks ago by Marty McFly.
The following user(s) said Thank You: klotim, conan2k, Androll, acknowledge, MakeNX, Sunesha, Sinclair
The topic has been locked.
  • WSH303
More
6 years 2 weeks ago #603 by WSH303 Replied by WSH303 on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Looks like it works:

i.imgur.com/JXzRerz.png

Cool.
The topic has been locked.
  • Marty McFly
  • Topic Author
More
6 years 4 days ago - 6 years 3 days ago #604 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
[strike] pastebin.com/ivmCBy0M [/strike]
[strike] pastebin.com/ySKiA6W5 [/strike]
pastebin.com/13NsGwtn

Latest MXAO beta update, requires ReShade 3.2.0 (latest reshade update). [strike]It has a division through 0 somewhere which I CANNOT find so it throws 3 identical warnings, hence "beta". [/strike] Crosire found it, please redownload/update to [strike]3.4.59[/strike] 3.4.60.

Changelog:
  • Fix problem with posterized AO by using 2 more textures that are guaranteed to be RGBA8 (instead of RGB10A2 which the backbuffer has on some games...)
  • Remove culling mask for being too buggy. I liked the concept but it wasn't 100% accurate (making it 100% accurate would result in 0 perf increase over not using it), plus the performance gain was not good enough to justify this. Could've added a toggle but I like MXAO being easy to configure.
  • Group tweakables with new ReShade 3.2.0 ui_category annotation, so MXAO can serve as a reference for this new feature.
  • Minor code restructurements for more performance
  • Rename each and every variable for better readability, IStartedToHateCamelCaseAndNeedSomeCoherency.
  • Relax the blur threshold a bit for smoother AO at large far plane values
  • Add 1 more blending mode which is experimental, might be removed or changed
  • Modify debug output to view the normals
  • Modify UI annotation of quality modifier to view the amount of samples (nerd statistics)
Last edit: 6 years 3 days ago by Marty McFly.
The following user(s) said Thank You: crosire, amoebae, jmx777, Ryukou36, Marty, Arkane
The topic has been locked.
  • Marty McFly
  • Topic Author
More
6 years 1 day ago #605 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Hey so I still got this raytraced AO solution and I plan on integrating it into MXAO, but before I do this, I'd like everyone's input on that. Key info:

-it's much slower so it's only viable for screenshots or if you have a beast system, there's no way I'll ever be able to make it remotely as fast as MXAO
-it's much, much more accurate, maybe difference isn't as apparent in regular mode but in debug you see it immediately, older games will benefit from it most likely as it can basically do all shading on its own, unlike regular SSAO which is meant to complement a lighting system
-it'd be an optional preprocessor toggle
The following user(s) said Thank You: conan2k, amoebae, jmx777, GP-Unity, Marty, Arkane
The topic has been locked.
  • ShoterXX
More
6 years 1 day ago - 6 years 1 day ago #606 by ShoterXX Replied by ShoterXX on topic Marty McFly's Ambient Obscurance (MXAO) with IL
blog.oxforddictionaries.com/2015/10/23/ways-to-say-yes/
TL;DR: Yes.

By the way, did you ever apply the median filter?
Last edit: 6 years 1 day ago by ShoterXX.
The topic has been locked.
  • robgrab
More
6 years 1 day ago #607 by robgrab Replied by robgrab on topic Marty McFly's Ambient Obscurance (MXAO) with IL
That would be awesome, Marty! You could make it like IL, where it's there if you choose to use it. I typically don't use it just because I can't really tell a difference with it on vs off. Probably depends on the game.
The topic has been locked.
  • Androll
More
6 years 1 day ago #608 by Androll Replied by Androll on topic Marty McFly's Ambient Obscurance (MXAO) with IL
What happened to MXAO_ENABLE_TSS stuff?
The topic has been locked.
  • Uncle Crassius
More
6 years 1 day ago #609 by Uncle Crassius Replied by Uncle Crassius on topic Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly wrote: Hey so I still got this raytraced AO solution and I plan on integrating it into MXAO, but before I do this, I'd like everyone's input on that.


The topic has been locked.
  • Tojkar
More
6 years 1 day ago #610 by Tojkar Replied by Tojkar on topic Marty McFly's Ambient Obscurance (MXAO) with IL
I am not so high on taking screenshots but I'd really like to know if my system is beast enough to run it in real time.
The topic has been locked.
  • Marty McFly
  • Topic Author
More
6 years 1 day ago - 6 years 1 day ago #611 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
@ShoterXX: I tried median filter back in MasterEffect days but it's not viable for this, GPU based sorting is just too slow and it doesn't look good. For purely random values this would make a difference but MXAO jitters in 4x4 pixels so only those pixels need to be averaged for a 100% smooth image. A diffuse spatial filter is probably better than my current filter, my raytraced AO uses one, I'm currently running experiments with this anyways.

@Androll: I removed it, ghosting was too severe and it really really wasn't viable. It'd have been cool but without temporal reprojection this is just not working out.

@Tojkar: Well, it is much more demanding than MXAO but it depends on the settings as well. MXAO samples in a 2D pattern so at some point it'll converge to a 100 percent smooth result, you can't see a difference between 64 samples + spatial filter vs 500 samples without filter. The raytraced (actually cone traced) AO on the other hand doesn't converge as fast so even with 32 rays 16 samples each you get noise. At some point you can ridiculously increase the samples without any visual change. 8 rays, 4 samples look good but not as good as full power so yeah, you can configure it to be playable but it'll always be more demanding than MXAO. MXAO lowest setting uses only 4 samples per pixel which is extremely low but still creates some sort of AO, raytraced AO needs many more samples to be coherent.
Last edit: 6 years 1 day ago by Marty McFly.
The following user(s) said Thank You: jmx777, Tojkar
The topic has been locked.
  • conan2k
More
6 years 1 day ago - 6 years 1 day ago #612 by conan2k Replied by conan2k on topic Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly wrote: Hey so I still got this raytraced AO solution and I plan on integrating it into MXAO, but before I do this, I'd like everyone's input on that. Key info:

-it's much slower so it's only viable for screenshots or if you have a beast system, there's no way I'll ever be able to make it remotely as fast as MXAO
-it's much, much more accurate, maybe difference isn't as apparent in regular mode but in debug you see it immediately, older games will benefit from it most likely as it can basically do all shading on its own, unlike regular SSAO which is meant to complement a lighting system
-it'd be an optional preprocessor toggle


The power of hardware is continuously growing. Besides, there are a lot of games and cases where 30 fps are enough for comfortable playback (i.e. where IQ has much higher priority over performance). So, please do add it as a future-proof option ;)
Last edit: 6 years 1 day ago by conan2k.
The topic has been locked.
  • robgrab
More
6 years 21 hours ago - 5 years 11 months ago #613 by robgrab Replied by robgrab on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Marty, is this the new raytraced AO that you were teasing a while ago as New SSAO ?

Last edit: 5 years 11 months ago by robgrab.
The topic has been locked.
  • Marty McFly
  • Topic Author
More
6 years 15 hours ago #614 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Yeah. Although I cheated a bit with this screenshot as the models are super detailed. It's the superposition benchmark from Unigine which features SSRTGI after which my AO is modeled. Unfortunately SSRTGI is closed source so I couldn't figure out how it works but from what I've measured, my AO is faster and looks roughly the same.
The topic has been locked.
  • Tojkar
More
6 years 1 hour ago #615 by Tojkar Replied by Tojkar on topic Marty McFly's Ambient Obscurance (MXAO) with IL
I got to say that AO looks so sexy, I'd rather look at it in the action than my rather sexy beast girlfriend herself.
The topic has been locked.
  • Marty McFly
  • Topic Author
More
5 years 11 months ago #616 by Marty McFly Replied by Marty McFly on topic Marty McFly's Ambient Obscurance (MXAO) with IL
I get it, you're single.
The following user(s) said Thank You: jas01
The topic has been locked.
  • jmx777
More
5 years 11 months ago #617 by jmx777 Replied by jmx777 on topic Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly wrote: Hey so I still got this raytraced AO solution and I plan on integrating it into MXAO


Thank you for this, your work is the best.
The topic has been locked.
  • Tojkar
More
5 years 11 months ago #618 by Tojkar Replied by Tojkar on topic Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly wrote: I get it, you're single.

I'm not. I just tried to compliment your work. Apparently I suck at it. :dry:
The topic has been locked.
  • lowenz
More
5 years 11 months ago - 5 years 11 months ago #619 by lowenz Replied by lowenz on topic Marty McFly's Ambient Obscurance (MXAO) with IL
A beast(y) girlfriend is some kind of were(she)wolf? :D
Last edit: 5 years 11 months ago by lowenz.
The following user(s) said Thank You: jas01
The topic has been locked.
  • jmx777
More
5 years 11 months ago #620 by jmx777 Replied by jmx777 on topic Marty McFly's Ambient Obscurance (MXAO) with IL
Hey Marty, whit the new experimental AO method we can expect results like (or near) the ones that are shown on Metro Exodus?
Here is a comparison pics:
abload.de/img/19jq6h.jpg (SSAO+IL)
abload.de/img/23tqio.jpg (Raytraced AO + GI)

Huge thanks for your work!
The topic has been locked.
We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.