Multichannel
Distance fields are generally stored in a single-channel texture, sampled using some kind of linear filtering. This is sufficient in almost all cases, but causes unsightly artifacts when used for complicated shapes that require sharp corners. These issues can be partially mitigated by increasing the SDF resolution, but this comes at the cost of memory.
Multichannel signed distance fields (MSDF) encode information about the curvature of the shape alongside the distance to its edge. This more accurately preserves sharp corners.
Hard mask | Soft mask | SDF | PSDF | MSDF | MTSDF | |
---|---|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |
Channels: | 1 (1-bit) | 1 | 1 | 1 | 3 | 4 |
Anti-aliasing: | - | Yes | Yes | Yes | Yes | Yes |
Scalability: | - | - | Yes | Yes | Yes | Yes |
Sharp corners: | - | - | - | - | Yes | Yes |
Soft effects: | - | - | Yes | - | - | Yes |
Hard effects: | - | - | - | Yes | Yes | Yes |