Marty McFly's Ambient Obscurance (MXAO) with IL
- Marty McFly
-
Topic Author

Overview
MXAO is a SSAO algorithm designed to be the perfect replacement for faulty AO implementations in modern games. To spice things up, it can also calculate Indirect Lighting. The performance and scalability allows almost GI-like scenes in some cases. Most noteable features are:
1. Scalability. It can both apply little shading almost for free or heavy shading for screenshots to completely change the look of the scenery. At low settings, its fps drop is not noticeable on GPU's like GTX 970 where HBAO+ or similiar algorithms dip the fps quite a bit. I managed to get 60 fps on a GT920.
2. To reduce the amount of needed post-blur, MXAO uses a non-random sampling distribution. Instead, it uses a 16x16 bayer matrix as distribution lookup combined with a fine-tuned algorithm to improve variance.
A lot of AO implementations reduce their effective sample count because many samples land on the same positions so the result is way more noisy than on other implementations with the same sample count. Due to the nature of the bayer matrix, the resulting pattern needs a lot less blur for completely smooth shades. (64 samples: 3 pixels radius for bayer, 8+ pixels radius for randomized samples).
3. The robust implementation allows for very wide-range AO with little decrease in performance due to minimum cache trashing. Again, a lot of AO shaders perform fairly fast for moderate sampling ranges but kill the performance for wide-range sampling. This is one of the most noteable features of the ENBSeries AO.
4. Reliable even with bad input data. Alchemy SAO for example needs very accurate linearizing function to function properly, while algorithms such as the Crysis SSAO run on almost everything. MXAO performs likewise.
Complete documentation PDF included in file.
Download
1.0r (mediafire)
1.1r (mediafire)
1.5.7r (pastebin)
2.0 (mediafire)(ReShade 3.0)
- Marty McFly
-
Topic Author
- robgrab
-
- crosire
-
Remove all shader files and install this one instead. Does not matter which ReShade version you are using.robgrab wrote: Just downloaded it. How do I install it? Do I use one of the older Reshade dlls or does it work with Reshade 2.0?
- aufkrawall
-
The AO looks very believable and is very clean in both still image and in motion.
Tested it in BF4:


Performance is totally ok as well.
Only thing I had to change was to set #define fMXAONormalBias to 0.4 to avoid some stripe pattern shimmering for some areas in motion.
I hope some game developers will notice this and maybe help them to implement better SSAO solutions by themselves.
- Crystrex
-
I'm just amazed how flexible config that helps to tweak a shader.
Have some questions:
There are tweaked version of MXAO. I have stable >30 FPS in Warframe.
My PC: 2.3ghz + geforce 525m
Screenshoots:
Config:
#define bMXAOIndirectLightingEnable 0 //[0 or 1] Enables Indirect Lighting calculation. Will cause a major fps hit.
#define fMXAOIndirectLightingAmount 1.0 //[0.0 to 8.0] Linearly increases IL intensity.
#define fMXAOIndirectLightingSaturation 1.0 //[0.0 to 3.0] Boosts IL saturation for more pronounced effect.
#define fMXAOSampleRadius 5.0 //[0.5 to 100.0] Sample radius of GI, higher values drop performance. Heavily depending on game, GTASA: 10 = GTA V: 40ish
#define iMXAOSampleCount 32 //[16 to 255] Amount of MXAO samples. Higher means more accurate and less noisy AO at the cost of fps.
#define bMXAOSmartSamplingEnable 1 //[0 or 1] Enables smart sample count reduction for far areas. May look ugly when low sample count (16 or less) is used, turn it off then.
#define fMXAOSampleRandomization 0.0 //[0.0 to 1.0] Breaks up the dither pattern a bit if sample spiral gets too visible (low samples and/or high radius). Needs stronger blurring though.
#define fMXAONormalBias 0.2 //[0.00 to 0.4] Normals bias to reduce self-occlusion of surfaces that have a low angle to each other.
#define bMXAOBackfaceCheckEnable 0 //[0 or 1] For indirect lighting only! Enables back face check so surfaces facing away from the source position don't cast light. It comes with a slight fps drop.
#define bMXAOBoundaryCheckEnable 0 //[0 or 1] Enables screen boundary check for samples. Can be useful to remove odd behaviour with too high sample radius / objects very close to camera. It comes with a slight fps drop.
#define bMXAOLowPrecisionEnable 1 //[0 or 1] Enables lower bit mode for AO source texture (R32F vs R16F). This will improve performance but may introduce some artifacts at distant objects.
#define fMXAOBlurSharpness 0.9 //[0.00 to 3.0] AO sharpness, higher means more sharp geometry edges but noisier AO, less means smoother AO but blurry in the distance.
#define fMXAOBlurSteps 4 //[2 to 7] Offset count for AO smoothening. Higher means more smooth AO but also blurrier AO.
#define fMXAOSizeScale 0.8 //[0.5 to 1.0] Resolution scale in which AO is being calculated.
#define fMXAOMipLevelIL 2 //[0 to 4] Miplevel of IL texture. 0 = fullscreen, 1 = 1/2 screen width/height, 2 = 1/4 screen width/height and so forth.
#define fMXAOMipLevelAO 1 //[0 to 2] Miplevel of AO texture. 0 = fullscreen, 1 = 1/2 screen width/height, 2 = 1/4 screen width/height and so forth. Best results: IL MipLevel = AO MipLevel + 2
#define bMXAODebugViewEnable 0 //[0 or 1] Enables raw AO/IL output for debugging and tuning purposes.
- Marty McFly
-
Topic Author
And why on earth did you set blur sharpness to 0.0? That defeats the whole idea of depth aware blur. Also, why setting the normal bias to 0? That is exactly there to cover artifacts like those I see in your screenshot. If you want stronger AO, raise the AO amount but don't lower normal bias to below 0.2.
- WLHM15
-
There's a way to do it better, find it - Thomas A. Edison
This is really a awesome work,
I just tested it, at Call of Duty : Modern Warfare 2 Game.
With ReShade 2.0 .dll, no color correction and no AA (really sucks

Here the result.
The quality is amazing, it do so well, no more blurry screen.
The performance is really great, it run more fps than HBAO or Alchemy SAO in same quality. And IL make the fps drop, but not to much.
- Crystrex
-
I'm continue to experimenting and fix this values.
- kanuuna
-
ON
OFF
Really clean work. This is impressive.
- GroinShooter
-
- roxahris
-
To follow on with the screenshot parade, here is a shot of the original Final Fantasy XIV . I'm stunned!
- aufkrawall
-
Impressive demonstration!kanuuna wrote: Pardon the aliasing, but I thought I'd post my results. I felt like downloading Crysis just for this.
- Marty McFly
-
Topic Author
GroinShooter wrote: Just tested and damn it looks good, but sadly only in still images and when no fog/smoke/windows are around. The problem is severe bleeding, which can be seen in a couple of shots here already. Bleeding makes all of these fancy AO techniques unusable for normal gameplay imo, is there no way to get rid of it completely or even make it far less noticeable?
Absolutely not. In regular engines, this is done by rendering AO etc before transparent objects or particles. As we can't do it and most of the effects don't differ in their color information from the surrounding environment, there is no possibility to separate those. Just because our eyes can distinguish between this doesn't mean an algorithm can. If I could write something on that level of content awareness, I'd sell it to the military and they would buy it. However I proposed some possibility to find out these areas by checking depth and color info. Most area with fog /smoke have largely same colors but their depth info is highly different (because the objects behind it are not flat) but that won't work in all cases.
- roxahris
-
- NotAgOat
-
Why is this replacing default files anyway? Why not add new effects to marty's shader folder?
- crosire
-
- Marty McFly
-
Topic Author
NotAgOat wrote: I replaced the default reshade.fx in the reshade folder with this one. I do not see the effect in the effects panel. Am I installing this incorrectly?
Why is this replacing default files anyway? Why not add new effects to marty's shader folder?
So people can test it before I integrate it in the Framework. When I do that, I' have to rewrite all the other AO shaders as well so this is a bigger bunch of work as I'm willing to do atm.
- NotAgOat
-
- Boulotaur2024
-
MXAO : fMXAOSampleRadius = 18, iMXAOSampleCount = 255
abload.de/img/deadislandgame_x86_rw2ypdr.png [
HBAO in GeDoSaTo ( Link )
abload.de/img/screenshot_2014-10-28w3po8.png
The brightness difference is irrelevant of course but I think the latter occludes the near objects a bit better than MXAO (see the shadows under close rocks) with less self-occlusion. While MXAO does a slightly better job for distanct objects.
Nothing that couldn't be fixed by tweaking a near plane parameter I guess... If it existed because I don't think you included a way to tweak it. I could only see a farZ one.
Other than that the performance is great !
In that last shot that I took way back in 2014 I remember the fps was crawling in the 10 fps (there was downsampling in the mix but even without it would kill the framerate with HBAO maxed out) while MXAO is performing really nicely even at high settings (the bayer pattern trick I guess)