FXAA Parameter Confusion

More
4 years 9 months ago - 4 years 9 months ago #1 by mathusummut
FXAA Parameter Confusion was created by mathusummut
I have a question about the popular FXAA shaders that are out there written using HLSL or GLSL, such as:
https://github.com/mattdesl/glsl-fxaa/blob/master/fxaa.glsl

Most of them mainly feature these three parameters:
    #define FXAA_REDUCE_MIN (1.0 / 128.0)  //0.0078125
    #define FXAA_REDUCE_MUL (1.0 / 8.0)  //0.125
    #define FXAA_SPAN_MAX 8.0

I looked all over the Internet, but could not find a proper explanation about the function of these three parameters. Can anyone help?
Last edit: 4 years 9 months ago by mathusummut.

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago - 4 years 9 months ago #2 by kingeric1992
Replied by kingeric1992 on topic FXAA Parameter Confusion
the inquired algorithm performs 1D sampling on direction perpendicular to luminance gradient with varying range with following behavior:

reduce sample range by nearby sum with scale factor defined by

FXAA_REDUCE_MUL: reduce scale multiplier
and
FXAA_REDUCE_MIN : minimum reduce scale

after that, FXAA_SPAN_MAX will force clamp the sample range.

as the out come, the sampling vector (A, B ) will be characterize as (A', B') with min(A', B') < 1, and if |A - B| < scale factor, max(A', B') will also be less then 1, that == no blurring.
Last edit: 4 years 9 months ago by kingeric1992.
The following user(s) said Thank You: mathusummut

Please Log in or Create an account to join the conversation.