Welcome, Guest.
Username: Password: Remember me

TOPIC: Marty McFly's Ambient Obscurance (MXAO) with IL

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #601

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 topic has been locked.
The following user(s) said Thank You: klotim

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #602

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: 1 year 6 months ago by Marty McFly.
The topic has been locked.
The following user(s) said Thank You: klotim, conan2k, Androll, acknowledge, MakeNX, Sunesha, Sinclair

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #603

Looks like it works:

i.imgur.com/JXzRerz.png

Cool.
The topic has been locked.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #604

pastebin.com/ivmCBy0M
pastebin.com/ySKiA6W5
pastebin.com/13NsGwtn

Latest MXAO beta update, requires ReShade 3.2.0 (latest reshade update). It has a division through 0 somewhere which I CANNOT find so it throws 3 identical warnings, hence "beta". Crosire found it, please redownload/update to 3.4.59 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: 1 year 6 months ago by Marty McFly.
The topic has been locked.
The following user(s) said Thank You: crosire, amoebae, jmx777, Ryukou36, Marty, Arkane

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #605

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 topic has been locked.
The following user(s) said Thank You: conan2k, amoebae, jmx777, GP-Unity, Marty, Arkane

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #606

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: 1 year 6 months ago by ShoterXX.
The topic has been locked.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #607

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.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #608

What happened to MXAO_ENABLE_TSS stuff?
The topic has been locked.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #609

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.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #610

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's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #611

@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: 1 year 6 months ago by Marty McFly.
The topic has been locked.
The following user(s) said Thank You: jmx777, Tojkar

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #612

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: 1 year 6 months ago by conan2k.
The topic has been locked.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #613

Marty, is this the new raytraced AO that you were teasing a while ago as New SSAO?

Last Edit: 1 year 5 months ago by robgrab.
The topic has been locked.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #614

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.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 6 months ago #615

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's Ambient Obscurance (MXAO) with IL 1 year 5 months ago #616

I get it, you're single.
The topic has been locked.
The following user(s) said Thank You: jas01

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 5 months ago #617

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.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 5 months ago #618

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.

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 5 months ago #619

A beast(y) girlfriend is some kind of were(she)wolf? :D
Last Edit: 1 year 5 months ago by lowenz.
The topic has been locked.
The following user(s) said Thank You: jas01

Marty McFly's Ambient Obscurance (MXAO) with IL 1 year 5 months ago #620

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.