Marty McFly's Ambient Obscurance (MXAO) with IL

  • Posts: 1221
4 years 1 week ago #101 by Marty McFly
Some updates on the MXAO, I posted these already in the screenshot thread.

Smoothed normal maps:

Warning: Spoiler! [ Click to expand ]


Some bent normal skylighting thingy I have been experimenting with. As it uses the unused RGB components for the AO texture when IL is off, it runs performance-free.

Warning: Spoiler! [ Click to expand ]
The following user(s) said Thank You: Boulotaur2024, jas01, Elimina, Tycholarfero, turtlevan
The topic has been locked.
  • Posts: 156
4 years 1 week ago - 4 years 1 week ago #102 by jas01
I would love to see your collaboration with Alenet. His Skyrim Reloaded - SKGE can be so much better with enb level occlusion and DOF..
The topic has been locked.
  • Posts: 1221
4 years 1 week ago #103 by Marty McFly
Well I would collaborate with a lot of people if they contacted me but for some reason noone knows me even though my work is in almost all non-ENB Skyrim mods or general graphics mods.
The topic has been locked.
  • Posts: 156
4 years 1 week ago #104 by jas01
I will write to him about you (your work). Maybe he will show some interest.. His project will be dead after Skyrim Special Edition.
The topic has been locked.
  • Posts: 10
4 years 3 days ago #105 by Estebanium
Mhh.. I tried MXAO out, but was not able to see any effect. I downloaded ReShade 2.0.3f1, copied ReShade folder, ReShade.fx and ReShade32.dll to my Civilization V folder. I then renamed ReShade32.dll to dxgi.dll and copied ReShade.fx and bayer16x16.png of MXAO to the folder of CIV V.
I started a game and activated bMXAODebugViewEnable, turning the left side white and the right side black. The same happened if I tried to use MXAO in Battlefield 2.

Any ideas?
The topic has been locked.
  • Posts: 1221
4 years 2 days ago - 4 years 2 days ago #106 by Marty McFly
If AO does not work, there are 2 possible reasons: ReShade does not detect the correct depth buffer, means that the AO can't reconstruct positions of objects and build up shadows. Second possible reason is that the linearizing function I use does not fit the depth buffer.

By default, the hardware depth buffer is not linear, means that 0 is camera, 0.999 is 1m away, 0.9999 is 100m away and so on, so it's extremely curved. What AO needs is 0 = camera, 1 = sky, 0.5 = halfway from camera to sky so depth buffer value is proportional to distance. MXAO has a function built in that converts the nonlinear buffer to linear, but some games have a differently curved depth buffer and using the standard formula on that does not work.

What you can do:
Civilization V is not in ReShade games list so I don't know which one of the cases it is.
Battlefield 2 is in the list, compatibility says perfect. If you play it online, then ReShade disables depth buffer, nothing to be done about that.
To test if the depth buffer is working for either of those games,, do the following: assuming you use MXAO 1.1r, go to line 381, it should say "res = color;". Right before that line, create some empty space between the #endif and the res=color line. Enter the following:
color = tex2D(SamplerDepth, texcoord.xy).x;
color = pow(color,10.0);

Now start the game again. If the resulting image is plain black or plain white, depth buffer is disabled or does not work, nothing to fix it. If you can see some contours of objects in any way, the linearizing function is wrong and I have to find one that works for you.
The topic has been locked.
  • Posts: 10
4 years 2 days ago #107 by Estebanium
Hi Marty,
thank you for your reply. I tested it in Battlefield 2 and yes it is working. If I add those two lines, I will see a contour of my rifle, but I fear that even in Singleplayer the depth buffer is offline. So I can only see my weapon, I did another test without those two lines and I will get a similar result with bMXAODebugViewEnable turned on. Does it mean that I will only have AO on my weapon and not on the landscape?

Did the same thing with CIV V and I can see something, but I guess that this game is a bit more complicated. Playing in DX11, I can see a contoure, but this is very precise.. One screenshot with and one without the two lines.


The topic has been locked.
  • Posts: 1221
4 years 2 days ago #108 by Marty McFly
For BF2, well, it's a common thing that fps shooters override the scene depth buffer with one that draws either HUD or weapon. So yeah, you will only have AO on the weapon and that's almost not noticeable.
Same goes for Civilization V, what you see there is that only the 3D model for this yellow beam in the sky is visible in the depth buffer, also no AO for you unfortunately :/
The topic has been locked.
  • Posts: 1221
3 years 11 months ago - 3 years 11 months ago #109 by Marty McFly
I will soon update MXAO to 1.3 which will feature some improvements such as a beta implementation of the smoothed normals, per pixel normals and most importantly, a brand new AO post blur algorithm that changes its blur directions depending on surface alignment so AO quality does not decrease that much with high blur levels because the usual blurring algorithms drag the AO shading too far from its intended position. Ideal blurred AO looks like unblurred AO with high sampling count.
The following user(s) said Thank You: Elimina, brinx2, piltrafus, Zyrusticae, plasticmind
The topic has been locked.
  • Posts: 533
3 years 11 months ago #110 by lowenz
Waiting eagerly for it!
The topic has been locked.
  • Posts: 17
3 years 11 months ago #111 by WSH303
Hi,

I have tested Reshade 2.0 of MXAO and in general it looks good, but there are some strange artifacts that spoil the effect:

i.imgur.com/D6Ln2gL.jpg

Can you see those lines right to the gun? Those appear only if you get close to any objects and looks like lots of independent.. uh, blurred borders of the gun. I tried to fix this by messing with settings, but with no luck.
The topic has been locked.
  • Posts: 118
3 years 11 months ago #112 by acknowledge

WSH303 wrote: Hi,

I have tested Reshade 2.0 of MXAO and in general it looks good, but there are some strange artifacts that spoil the effect:

i.imgur.com/D6Ln2gL.jpg

Can you see those lines right to the gun? Those appear only if you get close to any objects and looks like lots of independent.. uh, blurred borders of the gun. I tried to fix this by messing with settings, but with no luck.


I can also confirm that. MXAO creats several "ghost" around ingame objects. Enable debug view will make my discription clearer
The topic has been locked.
  • Posts: 8
3 years 11 months ago #113 by genstar

Marty McFly wrote: Some updates on the MXAO, I posted these already in the screenshot thread.


AO + Skylighting:


File Attachment:


Off/On comparison (best to open both pics in two tabs and compare)

File Attachment:

File Attachment:
[/spoiler]


Please, you can share files needed to get the result of the picture "AO + Skylighting". Please share, do not tell me how to do, because I do not understand much English. :unsure:
The topic has been locked.
  • Posts: 8
3 years 11 months ago #114 by genstar

Marty McFly wrote: I will soon update MXAO to 1.3 which will feature some improvements such as a beta implementation of the smoothed normals, per pixel normals and most importantly, a brand new AO post blur algorithm that changes its blur directions depending on surface alignment so AO quality does not decrease that much with high blur levels because the usual blurring algorithms drag the AO shading too far from its intended position. Ideal blurred AO looks like unblurred AO with high sampling count.

but Skylighting it will be included in the version MXAO 1.3?
The topic has been locked.
  • Posts: 47
3 years 10 months ago #115 by Boulotaur2024
Any ETA on this ? I'd love to try it out.

I remember trying really hard to get AO based on normal maps instead of flat polygons but always failed to. As far as I can recall the normal map had to be generated by a deferred renderer or something which no injector could provide. But I can barely remember the details now.

Good job anyway. One of the best HBAO implementations for sure
The topic has been locked.
  • Posts: 1221
3 years 10 months ago - 3 years 10 months ago #116 by Marty McFly
Hm I keep missing messages here because of the constant spam in this Stereoscopic shader thing.
Erm, I have been polishing MXAO a lot since the last release. It now runs a lot faster, looks better, requires no external texture anymore (I generate a 128x128 bayer matrix in code now which smoothens the AO even more). The post blur underwent a lot of changes, it uses something I like to call discrete linear sampling because it uses the same method to use less samples as discrete gaussian blur.

Also I tried deinterleaved texturing which was a bitch to implement only in pixel shader but it works! Except the performance gain is negative, a 2x4 deinterleaved pattern (4x4 reaches sampler limit in reinterleave pass on d3d9) runs with 2 times the technique time than MXAO alone and looks worse, I have no clue why. Only for 500+ samples it is faster than MXAO.
The following user(s) said Thank You: Sunesha
The topic has been locked.
  • Posts: 221
3 years 10 months ago #117 by Sunesha
That's really awesome. I like the performance and look of MXAO. It is hitting my computer about the same as driver forced HBAO. But got the awesome in direct lighting function. I like the shadows better it is less messy and more natural. Before I used driver HBAO and it was a pain to find specific flag to work with the game. Was not always possible and no control over the end result.

I still have to revert to Nvidia driver Hbao+ as some games just have non accessible depth buffer.

I really hope the skylighting part makes into the next version of the MXAO. But anyway is very cool to bring a modern occlusion to older games. Really love this effect as it brings out a new depth to the rendering of the games
The topic has been locked.
  • Posts: 1221
3 years 10 months ago #118 by Marty McFly
The problem with this effect is that it's incompatible with IL. Currently AO + IL fit into one RGBA texture (RGB = IL, Alpha channel = AO), I can put the bent normals into RGB as well so you have this light system but no IL. Using IL and this together would require 2 additional textures which is heavy on memory.
The topic has been locked.
  • Posts: 221
3 years 10 months ago #119 by Sunesha
I had to read this a couple of times to understand it all :whistle:

I see that it would be more things for the shader to do so the impact performance is not worth the cost.

I look forward to a leaner and better looking MXAO. Which Is welcome, it is always a compromise with my GTX 960. So every frame won is always something else I can throw in. Though I have fairly good results sometimes by lowering samplecount and sizescale
The topic has been locked.
  • Posts: 1221
3 years 10 months ago #120 by Marty McFly
Updated MXAO to 1.5.7r
Changelog:

-removed Sample Randomization, performance uncomparably lower because of cache misses
-removed bayer16x16.png dependancy, results in higher quality of AO
-changed blur weight calculation, heavily inspired from GFSDK
-added per pixel normals, this is a test
-various code restructurements for higher performance
-changed AO blur for better visuals and sharper AO result
-a lot more I probably forgot
The topic has been locked.