SharpVk-Samples
SharpVk-Samples copied to clipboard
Text example
Will there be an example how to draw text in C#? Like SaschaWillems´s textoverlay for C++ Thanks in advance for your answer.
I wasn't immediately planning on porting Sascha's Vulkan samples, but I can certainly take a look.
I will need some 3D rendering with in scene tooltips. I need to add it to existing app (multi-platform winforms), but I have no idea, how the different APIs available handle text rendering. And one more problem I need it in non English character set (ěščřžýáíéúů), which is problem for at least some APIs. Can I expect text rendering example anytime soon? Thanks in advance for your answer.
If you're talking about APIs at the Vulkan level (such as OpenGL or DirectX) there's no built-in support for text rendering; instead, you load a texture that is an image of the character set you're using (Sascha's sample uses bitmap fonts from http://nothings.org/stb/font/, e.g. this texture) and render a set of quads with texture coords for each character in your text string. Because the text rendering is something you implement, you can supply any character set you like; but it is something you have to implement, not something provided "out of the box".
Because it is relatively complicated the example "how to" should be good :)
Okay, I'll have a look at it this week.
Right, am working through porting Sascha's base type libraries, will start pushing some code samples ASAP.