Open akk0rd87 opened 2 years ago
This is already supported in SDL_ttf, checkout TTF_SetFontSDF()
I asked about SDF here and Sylvain_Becker pointed me to custom example for opengles only. And those code and shaders seems had written outside SDL, just as an example. It means it will be pain if someone wants to combine SDL_Renderer and code like this written by himself. Every change in src/render/ source may broke this compability.
I'm using my SDF shaders over opengles only and compability with SDL_Renderer was broken at least two times:
Second problem is that opengles is deprecated on ios, and I need to move SDF to metal. And I'm not sure if I can do it by myself.
yes, that would be possible if user can provide its own shaders to SDL. Currently shaders are specific to back-end, provided as source or binaries, so there are more platform code Hopefully with Ryan's universal shader language, that would make things easier.
I would like to know if it is possible to add this feature to SDL for support different drawing backends: opengl(es), Metal, Vulkan and etc.? It is cool technique for drawing scalable fonts and monocolor shapes without texture rasterization. All scaling is handled by GPU, not CPU.
See more: https://libgdx.com/wiki/graphics/2d/fonts/distance-field-fonts https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf