Multi-Channel Distance Fields

Previous Next

Multi-Channel Distance Fields



SDF textures are generally Monochrome or Alpha-Only textures where each pixel holds the distance to the closest edge. This magnitude is normally based on the Euclidean Distance, which is great for smoothing the glow and soft shadows, but tends to round the sharp corners and looses quality on highly concave sections.


To overcome this problem, SmartEdge introduces another way of representing the SDF fonts by also allowing Multi-Channel Distance Fields (MSDF).


SDF

MSDF


Contrary to SDF textures, Multi-Channel Distance Fields use 3 or 4 channels to represent more accurately the distance to the closest surfaces. At runtime a simple filtering is applied to allow Sharp Corners and avoid Roundness while increasing the render quality.




While MSDF textures do consume more space because they need to be RGB24 or RGB32 instead of Alpha8, the increased quality in the filtering allows using smaller textures while keeping a higher quality compared to SDF textures.


Effects


One problem with standard MSDF textures is that they keep the corners sharp at all times. This is great for rendering the main silhouette, but for rendering effects like Glow and Shadows, it maybe more desirable to keep the silhouette sharp while making the effects more soft and round.


SmartEdge introduces another render mode called MSDFA. This textures combine both an SDF and MSDF by storing the MSDF values in the Red, Green and Blue while using the Alpha for storing a soft and round SDF.

Using MSDFA, glow and shadows can be kept soft and avoiding hard edges (even when the text remains with sharp corners)


MSDFA

MSDF



Created with the Personal Edition of HelpNDoc: Produce electronic books easily