<aside> ℹ️
As of version 1.3.x there is now support for runtime SDF generation. All generation code from editor-only import pipeline were exposed for public use in both editor and runtime.
Also SDF generation backends has updated, now there is a new Jobs-based CPU generation backend, read more on: SDF Generation Backends
</aside>
Scene view
Editor component view
Code overview
Click Load Image button to select any *.png, it will generate SDF automatically. Then Generate SDF can be clicked to re-generated loaded image with current settings.
All generation related stuff is located inSDFGenerationUtil
For generation use either GenerateSDFSprite
, or GenerateSDFTexture
methods.
They will required optional
SDFGenerationSettingsBase
- same settings you define when generating SDF in editor import pipeline (BorderOffset, ResolutionScale, GradientSize). If null default settings will be used.SDFGenerationBackend
- what backend should be used (GPU or CPU), in editor import pipeline there is a dropdown to select it. If null backend will try to use GPU if accessible and fallback to CPU if no. See more about new backends in SDF Generation BackendsThere is two backends right now GPU and CPU, more about them here: SDF Generation Backends