Marty McFly's Ambient Obscurance (MXAO) with IL
- DeMondo
just leave it lad, take an ice-cold beer & enjoy the sun --> success guaranteed !
- Marty McFly
- Topic Author
Also, because I want to add MXAO the regular way and what you ask for is some dirty cut'n'shut edit I extremely dislike what's going on right now. The AO is released as a standalone so people can test it before I add it to the Framework (the right way). Why I take my time for that is simple: I learned a lot about AO when I worked on MXAO so I can improve all existing AO shaders quite a bit which means rewriting the whole AO code and that requires a whole lot more time than I can afford at the moment. Same thing I did with the Advanced DoF - something that also took its time.
You quoted some instruction by Genrix which you tried - and failed. That tells me that you have no knowledge about shaders at all (which is totally ok by the way, but don't aim too high then). This is by no means a simple thing that can be learned in a week or so. Are you expecting me to teach you enough of an exotic programming language with math probably years ahead of your school education level to edit a big ass project as the Framework by yourself? Sure, for the integration there is probably nothing actually shader code related necessary but you still need a feeling what's going on in the structure to know what you are doing, otherwise you can just blindly test things and hope it works by luck.
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.
- crosire
- NotWorthy
Thanks again Marty for this great gift to the community. So many games to replay with this.
Original:
Normal MXAO:
Colorized MXAO:
- Marty McFly
- Topic Author
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.
- 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
- Marty McFly
- Topic Author
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.
- 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
- Marty McFly
- Topic Author
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.
- 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
- Marty McFly
- Topic Author
Btw the rectangle is depth buffer from ReShade, disable minimap then ReShade grabs the correct depth buffer.
- 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?
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.
- Marty McFly
- Topic Author
- Genrix
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.
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.
- 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.
- Scorpio82CO
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
in game shot..paused (WOW!!)
- Marty McFly
- Topic Author
@everyone: I might push an update for MXAO tomorrow.
- NotWorthy
Marty McFly wrote: @everyone: I might push an update for MXAO tomorrow.
Awesome - what will be improved?
- Marty McFly
- Topic Author
-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.
-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
- piltrafus