0
\$\begingroup\$

I have a question about the popular FXAA shaders that are out there written using HLSL or GLSL, and they all 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

What is the function of each parameter?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Thanks to user kingeric1992 who answered in this other forum:

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .