martymcmodding / qUINT

Collection of general-purpose effects for the ReShade shader injector.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MXAO feature request: make PS_SpatialFilter1 blur radius settable in UI

ewelsh42 opened this issue · comments

I'm using MXAO at strength 0.2 to add in some additional AO shadow depth on top of the weaker in-game SSAO built into the new Witcher 3 next-gen update (DX12, the in-game SSAO in the DX11 binary doesn't appear to do much for some reason). Anything above 0.2 results in noticeable motion shimmer in nearby grass and trees when they sway in the wind. Even strength 0.2 has a decent amount of shimmer, but it seems a reasonable compromise. I noticed that the older PPFX_SSDO.fx shader has a blur radius that is quite effective at tamping down shimmering artifacts. I was able to achieve a similar effect with MXAO by letting the user set the blur radius for the PS_SpatialFilter1() call, and setting it to 3.0 instead of the default 0.75. Anything above 3 and the horizontal ghosting becomes too much for my liking. There may be a better way to achieve the same result, but this is a quick and dirty fix that is useful to me, so I thought I'd suggest adding it officially. diff -d -c given below:

*** qUINT_mxao.fx.original 2021-07-17 12:23:00.000000000 -0400
--- qUINT_mxao.fx 2023-01-11 04:51:02.759439400 -0500


*** 135,140 ****
--- 135,149 ----
> = 1.0;
#endif

  • uniform float MXAO_BLUR_FILTER_RADIUS <
  •   ui_type = "slider";
    
  •   ui_min = 0.00; ui_max = 3.00;
    
  •   ui_step = 0.01;
    
  • ui_label = "Pre-blending Blur Filter Radius";
    
  •   ui_tooltip = "Spatial blur to reduce AO shimmer. Blending mode 2 lessens ghost halos at larger radii.";
    
  • ui_category = "Blending";
    
  • = 0.75;

  • uniform int MXAO_BLEND_TYPE <
    ui_type = "slider";
    ui_min = 0; ui_max = 3;

*** 572,578 ****

void PS_SpatialFilter1(in MXAO_VSOUT MXAO, out float4 color : SV_Target0)
{
! color = blur_filter(MXAO, sCommonTex0, MXAO_GLOBAL_RENDER_SCALE, 0.75, 4);
}

void PS_SpatialFilter2(MXAO_VSOUT MXAO, out float4 color : SV_Target0)
--- 581,587 ----

void PS_SpatialFilter1(in MXAO_VSOUT MXAO, out float4 color : SV_Target0)
{
! color = blur_filter(MXAO, sCommonTex0, MXAO_GLOBAL_RENDER_SCALE, MXAO_BLUR_FILTER_RADIUS, 4);
}

void PS_SpatialFilter2(MXAO_VSOUT MXAO, out float4 color : SV_Target0)