Skip to content

Fast FXAA Pass

Adam Gorski edited this page Aug 16, 2021 · 1 revision

Performance FXAA

XFDraw includes a built in FXAA shader that should take around 3ms for a 1080p image. It is faster than any custom FXAA shader since it skips the edge pixels on the screen, so when it samples neighbouring pixels it can skip the bounds check, improving performance.

Example usage

//Draw objects to the colorBuffer
GLTexture colorBuffer = ...;
GLTexture finalBuffer = ...;

//Draw objects to the colorBuffer 
DrawObjects(colorBuffer, ...);

//Run the FXAA Pass to output the final image to the finalBuffer 
GLFast.FastFXAA(finalBuffer, colorBuffer);

//Display the result
GL.Blit(finalBuffer, yourFormData);

The FXAA pass performs no type checking, and will only work on 32bpp images. If you give it a float buffer it will treat its bytes as ARGB colors.

Clone this wiki locally