Marty McFly's Ambient Obscurance (MXAO) with IL

  • Posts: 220
4 years 3 months ago #61 by DeMondo
@alloen:
just leave it lad, take an ice-cold beer & enjoy the sun --> success guaranteed ! B)
The topic has been locked.
  • Posts: 1221
4 years 3 months ago - 4 years 3 months ago #62 by Marty McFly
Warning: Spoiler! [ Click to expand ]


Let's put an end to this. If you want to add MXAO on yourself to the Framework in some way, go ahead, but don't derail this thread for that. This thread is to discuss the effect itself, improvements, opinions and so on. The purpose here is to give feedback on the functionality so I can improve the shader and see if it works for everyone the same way it works for me.
The topic has been locked.
  • Posts: 3750
4 years 3 months ago #63 by crosire
Framework's gone with 3.0 anyway.
The following user(s) said Thank You: Marty McFly
The topic has been locked.
  • Posts: 10
4 years 3 months ago #64 by NotWorthy
I'm a fan of "in your face AO" so I went a little frivolous with the settings - also I colorized the the shadow output because a) i like colors b) to make Marty cringe at the sight of someone basterdizing his awesome shader so much. (and it is aweomse)
Thanks again Marty for this great gift to the community. So many games to replay with this.

Original:

Normal MXAO:

Colorized MXAO:
The topic has been locked.
  • Posts: 1221
4 years 3 months ago - 4 years 3 months ago #65 by Marty McFly
Colorized AO isn't that bad, but take care to apply the colorization before the AO fade out because as you can see, the sky color is affected.

Pushing an update soon-ish, I improved the bilateral filter a tiny bit to improve performance, the AO falloff formula changed a LOT so the sampling range is used better. Side effect that radius 5 looks like radius 15 to 20 now but settings with same visual result before / after run a lot faster. So old radius 15 runs a lot slower than new radius 5 despite looking largely same. Also I've changed the IL calculation formula so IL doesn't get killed away by AO anymore so bright objects cast their light, no matter how strong the occlusion is.
The topic has been locked.
  • Posts: 351
4 years 3 months ago #66 by Quentin-Tarantino

NotWorthy wrote: I'm a fan of "in your face AO" so I went a little frivolous with the settings - also I colorized the the shadow output because a) i like colors b) to make Marty cringe at the sight of someone basterdizing his awesome shader so much. (and it is aweomse)
Thanks again Marty for this great gift to the community. So many games to replay with this.

Original:


Normal MXAO:

Colorized MXAO:


Change the sky colour in the Timecycle so it ain't green
The topic has been locked.
  • Posts: 1221
4 years 3 months ago #67 by Marty McFly

Marty McFly wrote: Colorized AO isn't that bad, but take care to apply the colorization before the AO fade out because as you can see, the sky color is affected.

The topic has been locked.
  • Posts: 10
4 years 3 months ago #68 by NotWorthy

Marty McFly wrote:

Marty McFly wrote: Colorized AO isn't that bad, but take care to apply the colorization before the AO fade out because as you can see, the sky color is affected.


Actually I made it fade out to green on purpouse because I felt the color of the foliage is greatly underrated in most presets and I didn't exclude the sky cos green sky be trippy.
Here's the code I used:
float colorRatio = ( min(color.x,min(color.y,color.z))/max(color.x,max(color.y,color.z)));
float4 colMax = color-min(color.x,min(color.y,color.z))+0.01;
colMax /= max(colMax.x,max(colMax.y,colMax.z))*2;
color.xyz *= mxao.w*mxao.w;
color+=(1.0-mxao.w*mxao.w)*(colMax-colorRatio)*0.5+0.2-scenedepth*float4(0.333,0.222,0.333,1.0); // OMG HE MULTIPLIED GREEN BY 0.222 THE HORROR
It would be nice if your final version of AO included some form of colorization Marty - for one thing you'd save noobs like me the embarrasment of coming up with blasphemously ugly pseudo-math code that is an afront to the almighty god of gamma-correction. I just throw around random numbers until the effect doesn't make my eyes bleed. Take pitty on my eyes - add a PRoper colorized shading option in MXAO :)
The topic has been locked.
  • Posts: 1221
4 years 3 months ago - 4 years 3 months ago #69 by Marty McFly
Colorized shadows is a nono, sorry. AO itself must be grayscale. And the colors come from IL anyways.
But if you really want it, how about:
float3 overlaycolor = normalize(float3(0.0,0.6,0.3));
color.xyz *= lerp(2.0*overlaycolor.xyz*mxao.w, 1.0-2.0*(1.0-overlaycolor.xyz)*(1.0-mxao.w), step(0.5,mxao.w));

instead of the regular AO apply code.
The topic has been locked.
  • Posts: 10
4 years 2 months ago #70 by NotWorthy

Marty McFly wrote: Colorized shadows is a nono, sorry. AO itself must be grayscale. And the colors come from IL anyways.
But if you really want it, how about:

float3 overlaycolor = normalize(float3(0.0,0.6,0.3));
color.xyz *= lerp(2.0*overlaycolor.xyz*mxao.w, 1.0-2.0*(1.0-overlaycolor.xyz)*(1.0-mxao.w), step(0.5,mxao.w));

instead of the regular AO apply code.


I didn't like your green tint code, but I did like the way you apply color to the image so here - the best of two worlds:


And in this context I have two questions for you:
1) Any idea how to remove/decrease the bigger rectangle around the minimap thats not passing a valid depth buffer for the AO to work?
2) Would you allow me to offer my color version of your AO to the gta5-mods.com community in any of these forms? :
- Publishing a modified version of your MXAO.h with my code added crediting you as the original mastermind and me as a simple code adder
- Publishing your unchanged MXAO.h with credits to you and instructions how to change it to get the color effect
- Linking to VisualV to get your AO file and adding instructions on how to modify it to get my effect

MXAO is a labor of love i see that so I can't blame you for wanting to protect all the praise you deserve for it but if any of the scenarios work for you please let me know which.

I'm also working on a mod that displays the GPS color route right on the street in front of your car - but i needed a couple of your functions for it to make it work - like the depth buffor calibrating and getting normals from the depth buffer - would it be okay for me to publish my mod with your functions assuming i would credit them as being developed by you?

THANKS and rock on your awesome shader booty :)
The topic has been locked.
  • Posts: 1221
4 years 2 months ago #71 by Marty McFly
Yeah do as you wish. But err, how could my functions help you with your gps mod?? It cannot be a shader so how and why did you use my stuff? O.o
Btw the rectangle is depth buffer from ReShade, disable minimap then ReShade grabs the correct depth buffer.
The topic has been locked.
  • Posts: 10
4 years 2 months ago #72 by NotWorthy

Marty McFly wrote: But err, how could my functions help you with your gps mod?? It cannot be a shader so how and why did you use my stuff? O.o


Actually i have sort of working version already - its not to pretty and loses some accuracy on various vehicle velocities but it works and only bases on reshade - i needed your normals to determine where theres a flat surface IE street to only draw the path on the road and not the buildings.
The topic has been locked.
  • Posts: 1221
4 years 2 months ago - 4 years 2 months ago #73 by Marty McFly
How do you pass such game data to ReShade? Or do you upscale the navigation system route of the minimap?
The topic has been locked.
  • Posts: 12
4 years 2 months ago - 4 years 2 months ago #74 by Genrix
For use MXAO with ReShade 2.0 you will need read post #37 reshade.me/forum/shader-presentation/187...th-il?start=20#14425
but for v2.0 you will need put ReShade_MXAO.fx in your parent(disrib) Reshade dir, not in the game dir.
Next you will need to comment out a line #145 in ReShade_MXAO.fx by adding // before the line, to avoid an error - redefinition of linearization of a buffer depth.
Now you got to work MXAO automatically in all of your games with ReShade, MXAO now applies globally.
If you want to disable MXAO just press NUM5 button.. :)
Probably this method isn't that elegant, but it simple and works just fine. :blush:

A guide for Reshade1.1 and 2.0 works just fine in DL:F and Fallout4. If it doesn't work for you, try to disable any overlays, such as Fraps, MSI AB and you should disable MSAA as well.
The following user(s) said Thank You: SSSekky
The topic has been locked.
  • Posts: 10
4 years 2 months ago #75 by NotWorthy

Marty McFly wrote: Or do you upscale the navigation system route of the minimap?


You guessed it

Now i know this effect is easibly achieved and can be done better by a faster coder than myself - so all i ask if anyone picks up on the idea to keep me in the loop - i'm not releasing the code yet because it's not yet tweaked to work with every resolution.
The following user(s) said Thank You: crosire, DeMondo
The topic has been locked.
  • Posts: 90
4 years 2 months ago #76 by Scorpio82CO
MXAO in DX HR works!!

I probe any AO shaders and flags for this game..only works with nvidia inspector flags but partially good
but.. i probe this in dx but is weird....works only when i have paused the game, but its perfect!!.. Mr MC Fly..there are anything to do to work completely..??? i hope to found some clue for you... with games where deph buffer does not show..

some shots

in game shot, in game AO off but MXAO on not showing
File Attachment:


in game shot..paused (WOW!!)
File Attachment:
The following user(s) said Thank You: DeMondo
The topic has been locked.
  • Posts: 1221
4 years 2 months ago - 4 years 2 months ago #77 by Marty McFly
Wait...even if depth buffer didn't work, the debug should show up, maybe gray/black but still visible.

@everyone: I might push an update for MXAO tomorrow.
The following user(s) said Thank You: CUBER, Scorpio82CO, DeMondo
The topic has been locked.
  • Posts: 10
4 years 2 months ago #78 by NotWorthy

Marty McFly wrote: @everyone: I might push an update for MXAO tomorrow.


Awesome - what will be improved?
The topic has been locked.
  • Posts: 1221
4 years 2 months ago - 4 years 2 months ago #79 by Marty McFly
I did various changes and tests over time, not all turned out to be good, so here's what I find when looking through the file:

-changed the falloff formula so the samples are now better used. This has the side effect that AO radius looks now much larger, 1.0r sample radius of say 10.0 has same visual result of 1.1r with sample radius of about 3-4. However settings with same visual result run faster now, especially noticeable for large scale AO.
-changed the blending formula, AO does not kill off IL anymore and vice versa. I think these screenshots show it very well. I didn't use the best scene but it should show that the white door now illuminates the rest while on the old AO code, the IL gets killed away even though I use a stronger IL setting.

Warning: Spoiler! [ Click to expand ]


-changed the smart sampling formula. Now the far areas don't have a ridiculous low sampling amount anymore which made lower end settings flicker in far areas because you had like 4 samples
-changed the sample distribution a tiny bit so the AO looks better on low sample count.
-changed the sample randomization code for both better sample distribution and less noise so it doesn't need so much more blurring than before. On low sample counts the AO shadowing keeps its shape now, the old code diffused it away.
-tiny change in the AO blurring (actually I just increased the offset) that makes blur smoother now by a small margin
-small fix that reduces the z artifacts with low precision mode almost to 0 so there is no real reason anymore to use high precision
-simplified code of blur tap detection, might improve fps by a little margin but I doubt it will be noticeable

in short: AO looks better, runs faster, features do their job better.


DOWNLOAD
The following user(s) said Thank You: SpinelessJelly, CUBER, Elimina, DeMondo, Golgotha, piltrafus, Genrix
The topic has been locked.
  • Posts: 92
4 years 2 months ago #80 by piltrafus
I haven't tried it yet but I wanted to thank you for your continuous and generous contribution. The first iteration of MXAO is really great. Unbelievable quality for the low FPS impact it offers. Hats off. And thanks again for just sharing it openly.
The topic has been locked.