OpenGL smooth text/fonts lazarus / 70-OpenGL ---------------------------------------------------------------------- SymbolicFrank · 2015-12-05 01:37 Would there be interest in a module that prints smooth (anti-aliased and such) fonts in any size, including user-defined? Because there doesn't seem to be one for Lazarus, and I have a half completed one laying around. ---------------------------------------------------------------------- AnthonyTekatch · 2015-12-05 03:20 Yes, there would be interest! Please continue. ---------------------------------------------------------------------- Jurassic Pork · 2015-12-05 04:50 hello, have a look  here ---------------------------------------------------------------------- aradeonas · 2015-12-05 12:25 Yes sure! Jurassic Pork BGRA is very good but doing it in OpenGL is a different subject specially smooth font render. ---------------------------------------------------------------------- marcov · 2015-12-05 13:01 Yes, there is a demo that uses signed distance fonts, with antialiassing using shaders: http://forum.lazarus.freepascal.org/index.php/topic,30556.msg194612.ht ml#msg194612 It was actually the last post in the board when you posted . But there are no fonts in the title, so I improved the title to include "signed distance fonts" ---------------------------------------------------------------------- aradeonas · 2015-12-05 13:04 I check that demo before but it doesn't seem smooth. ---------------------------------------------------------------------- marcov · 2015-12-05 13:44 Quote from: aradeonas on December 05, 2015, 02:04:02 pmI check that demo before but it doesn't seem smooth. As far as I can see it is smooth, but not anti aliased. Though afaik the code should do it, but maybe the outline support interfered. I haven't done much work on that (since the fontsupport it replaces is also not antialiased) The original article is here: http://www.valvesoftware.com/publication s/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf ---------------------------------------------------------------------- aradeonas · 2015-12-05 13:55 QuoteAs far as I can see it is smooth, but not anti aliasedAn I meant anti aliased. Anti aliased seems a problem in OpenGL and should made from us not OpenGL it self. ---------------------------------------------------------------------- marcov · 2015-12-05 15:05 Quote from: aradeonas on December 05, 2015, 02:55:19 pmQuoteAs far as I can see it is smooth, but not anti aliasedAn I meant anti aliased. Anti aliased seems a problem in OpenGL and should made from us not OpenGL it self. As said I haven't really investigated that since most my characters are relatively small, and the background is uneven anyway (hence the outline fonts). IIRC I disabled blending, choosing clipping based on some hints in the delphigl forum, maybe it could be turned back on using an anti aliasing function. ---------------------------------------------------------------------- Carver413 · 2015-12-05 17:22 Quote from: aradeonas on December 05, 2015, 01:25:55 pmYes sure! Jurassic Pork BGRA is very good but doing it in OpenGL is a different subject specially smooth font render. It is quite common to use textures for font display, in the end they often provide the best looking results. ---------------------------------------------------------------------- aradeonas · 2015-12-05 17:41 QuoteIt is quite common to use textures for font display, in the end they often provide the best looking results. I m doing this right now but for some cases OpenGL way is much faster especially when you change text a lot. ---------------------------------------------------------------------- Carver413 · 2015-12-05 19:04 Quote from: aradeonas on December 05, 2015, 06:41:38 pmQuoteIt is quite common to use textures for font display, in the end they often provide the best looking results. I m doing this right now but for some cases OpenGL way is much faster especially when you change text a lot. using a more modern opengl will do a lot to improve performance. I am using a texture based gui on top of opengl and for the most part I am pleased with the results.I only have a single core cpu and an older graphics card. if I had a multi core I think I would focus more splitting up the texture rendering. I think that Vulkan will prove to be more useful in low level design so I'm not really digging too deep with the opengl but rather improving the cpu side of things and formulating Idea's of how it will work with Vulkan in the future. I would rather have a single design that would serve all my needs. ---------------------------------------------------------------------- aradeonas · 2015-12-05 19:28 Quoteusing a more modern opengl will do a lot to improve performance. I am using a texture based gui on top of opengl and for the most part I am pleased with the results.I only have a single core cpu and an older graphics card. if I had a multi core I think I would focus more splitting up the texture rendering. I think that Vulkan will prove to be more useful in low level design so I'm not really digging too deep with the opengl but rather improving the cpu side of things and formulating Idea's of how it will work with Vulkan in the future. I would rather have a single design that would serve all my needs.yes Im interested in Vulkan to waiting for it. About your gui system I like to know more about it because I tried to make a simple system for myself , if you want to share I be more than happy. ---------------------------------------------------------------------- Carver413 · 2015-12-06 15:41 Quote from: aradeonas on December 05, 2015, 08:28:20 pmQuoteusing a more modern opengl will do a lot to improve performance. I am using a texture based gui on top of opengl and for the most part I am pleased with the results.I only have a single core cpu and an older graphics card. if I had a multi core I think I would focus more splitting up the texture rendering. I think that Vulkan will prove to be more useful in low level design so I'm not really digging too deep with the opengl but rather improving the cpu side of things and formulating Idea's of how it will work with Vulkan in the future. I would rather have a single design that would serve all my needs.yes Im interested in Vulkan to waiting for it. About your gui system I like to know more about it because I tried to make a simple system for myself , if you want to share I be more than happy. The Explorer model is very different kind of framework as it doesn't follow the standard delphi design model. linklist design,scripted frontend, much more abstract as I like to tinker alot. the end goal for the Explorer is to create a RPG/Progcedural game engine/ design studio of a sort. nothing like skyrim of course since most of the content would be created with scripts and a little bit of cad intermixed. I do not know when it would be release as it is just a hobbie for me. http://i67.tinypic.com/2cz3rfd.jpg ---------------------------------------------------------------------- Carver413 · 2016-01-04 00:16 http://i66.tinypic.com/10753bo.jpg I did a little experimenting to see if I could make a smoother looking font and this is what I ended up with. ---------------------------------------------------------------------- aradeonas · 2016-01-04 10:51 Very good ---------------------------------------------------------------------- circular · 2016-04-05 07:41 Hello folks, It is now possible to render and display fonts within BGRABitmap+OpenGL. See latest release: http://forum.lazarus.freepascal.org/index.php/topic,24239.msg206957.ht ml#msg206957 You can use the LCL renderer, FreeType renderer or if using BGRABitmap+ZenGL, use ZenGL fonts. Basically you can instantiate a font with BGLFont function, and then draw it directly on OpenGL surface. It internally makes and caches bitmaps for each glyph, so that it is fast enough for real-time. Regards ---------------------------------------------------------------------- aradeonas · 2016-04-05 08:46 Very good, I will test it soon. Thank you very much.