feat: Dynamic Runtime Rasterized MSDF Sprite Font#3055
feat: Dynamic Runtime Rasterized MSDF Sprite Font#3055yuechen-li-dev wants to merge 66 commits intostride3d:masterfrom
Conversation
|
@dotnet-policy-service agree |
|
We already have an offline SDF option - but I understand that the reason you implemented this feature is because non-latin character sets tend to be very large and require a high resolution. Offline SDF we currently have wouldn't work because it would have to cover multiple thousands of characters with a fairly high resolution, potentially blowing out build sizes. Definitely cool to see, now, is there a particular reason why this PR specifically sidesteps using most of the logic already setup for offline SDF ? Also, as it stands, the limitations seems a bit like a show stopper. Our engine already has enough quirk as it is, best to fix those before we merge this in |
…y forcing warm-up before async.
…agnostic-test Add bounded runtime SDF glyph upload convergence diagnostic
…now uses rasterized preview in asset thumbnails for editor stability/readability.
…classes from the RT-SDF font file.
…ests-for-runtimesigneddistancefieldspri Finalize Runtime SDF diagnostics into focused regression tests
|
That's also my take. Our project is open source so our direct consumption is fine. For users of the engine, it falls under transitive dependency which is also covered by the opensource license. We just need to be careful and monitor any change in licensing terms. |
Easily. You can just call the rasterizer, which is designed to be reusable, or implemented it with the library. It's one of the key blockers before implementing something like rounded corner rectangles in the UI, which relies very heavily on SDF. |
Great to hear that! |
…-compile-errors Fix runtime MSDF outline extraction after SharpFont removal
…sdf-outline-extraction Add focused runtime MSDF rasterizer/extractor regression tests
It is already part of the PR as this is a necessary functionality for this feature to work. After this, I think msdfgen.exe can just be removed if the old static SDF font was migrated to the new rasterizer or removed altogether. |
PR Details
This PR adds an experimental runtime MSDF font path to Stride’s sprite font system.
Introduction
Stride’s current sprite font rasterization options each have trade-offs. Dynamically generating MSDF glyphs on-demand is the common approach in modern engines (e.g., Unity/Unreal): it combines the benefits of Stride’s runtime rasterized fonts (large character sets like CJK) with offline SDF/MSDF advantages (smooth edges at high resolution, easy scaling) with minimal downsides.
Implementation
Dynamic MSDF generation differs substantially from Stride’s existing static SDF pipeline.
Rasterizer backends
Two managed, cross-platform MSDFGen ports are included (no P/Invoke):
Also included:
Notes / limitations
Testing
Core files:
RuntimeSignedDistanceFieldSpriteFont.csSharpFontOutlineExtractor.csMsdfGenCoreRasterizer.cs(MSDFGen-Sharp backend)RemoraMsdfRasterizer.csThanks. This took a lot longer than I thought it would.
Comparison
Existing Runtime Rasterized Font:


New Runtime MSDF Font:
Related Issue
#2584
Types of changes
Checklist