AnalyticSDFAAStrategy

Analytic SDF silhouette AA via fragment-shader coverage.

In the namespace construct::aa. Declared in src/libs/libconstruct/construct/aa/AnalyticSDFAAStrategy.hpp.

Detailed description

Computes per-pixel coverage at the SDF silhouette inside the shading shader, using the G-buffer depth + fwidth() to derive a soft falloff over roughly one pixel's worth of depth gradient. The fragment outputs an alpha value < 1.0 at silhouette pixels; the shading pipeline uses src-alpha blending to mix the rendered sphere color with whatever was already in the framebuffer (the environment / sky drawn earlier).

Trade-offs vs the other AA families:

- Cheapest per-pixel cost — no extra RT, no extra passes, just a couple of texture reads + fwidth() calls inside the existing shading shader. - Sharpest result for SDFs specifically — the coverage is computed from the actual sub-pixel surface position (encoded in the G-buffer depth + its derivative), not from resolving multiple samples (MSAA can't see this, SSAA needs N× the shader work, FXAA guesses from luma neighbours). - Only applies to SDF surfaces. Mesh / overlay edges still alias — combine with FXAA via a composite for those.

Architecturally: this is the only strategy that uses the wantsAnalyticEdgeAA() hook. The pipeline reads the bit at initialize / strategy-change time and pushes it into the SDFLayer's shading uniforms.

In this section