FXAA

Fast approximate anti-aliasing for the WebGPU composer.

FXAA (fast approximate anti-aliasing) smooths jagged edges in one cheap pass. It wraps three's FXAANode. It can also blur thin lines and small text. For sharper edges, use SMAA.

It is an LDR effect. It runs after tone mapping, on display colors, so it finds the edges the viewer sees.

Usage

Turn off the canvas antialias when you use FXAA, so the edges are not anti-aliased twice.

<script setup lang="ts">
import { TresCanvas } from '@tresjs/core/webgpu'
import { EffectComposer, FXAA } from '@tresjs/post-processing/webgpu'
</script>

<template>
  <TresCanvas :antialias="false">
    <!-- Your scene -->

    <EffectComposer>
      <FXAA />
    </EffectComposer>
  </TresCanvas>
</template>

Props

FXAA has no props.

Differences from FXAAPmndrs

FXAA has no props, because three's FXAANode takes no parameters. Its tuning values are constants in the shader.

FXAAPmndrsWhy it is not available
minEdgeThresholdFXAANode uses a fixed contrast threshold of 0.0312.
maxEdgeThresholdFXAANode uses a fixed relative threshold of 0.063.
subpixelQualityFXAANode uses a fixed subpixel blending of 1.
samplesFXAANode searches at most 6 steps in each direction along an edge. The limit is fixed in the shader.
opacity, blendFunctionThe WebGPU family has no blend functions. See Blending.