Standard SDF (Single Channel)
Notice the rounded corners and artifacts at sharp edges. Single-channel SDF stores only distance to nearest edge.
MSDF (Multi-Channel)
Sharp corners preserved! RGB channels encode directional distance, reconstructed via median function.
How MSDF Works
The Problem: Standard Signed Distance Fields (SDF) use a single value per pixel
representing distance to the nearest edge. This works well for smooth curves but fails at sharp
corners—they become rounded when zoomed in.
The Solution: Multi-channel SDF (MSDF) uses RGB channels to encode directional
edge information. Each channel stores the distance to edges in different quadrants. The final
distance is computed using the median of R, G, B values, which correctly reconstructs
sharp corners at any scale.