by ibm5155 » Fri Apr 17, 2015 8:47 am
Gez wrote:ibm5155 wrote:Text rendering is freaking slow, idk how is it made but if it's not this way, I would sugest doing a sprite rendering instead of text.
I did a SDL console, and the text rendering method was so slow that it would be useless to make a console game, so I did a test with a spriteblock, and I rendered each letteras a image, and boom, I got 1000fps

...
Real fonts are extremely complex. They're not just a collection of graphics for each glyph, they are pretty much programs in their own right. Read the articles on
Graphite and
OpenType to get an idea of how much stuff happens under the hood when you render a font properly.
Most of that is overkill for the typical Doom mod, where you don't really need to handle ligatures and nobody will really mind if hyphen, minus sign, em dash and en dash are all the same symbol. Obviously when rendering a letter consists in copying a graphic it's a lot faster than when it consists of running a program that will scan the context of the letter to see how it should be rendered exactly.
Indeed, I already saw how complex a real font is, and that's why I just used the good and old sprite block, since my software was to emulate a terminal, it worked quite well.
I can only think some things about the pointed issues.
Indeed, scalling for a high resolution monitor may look bad with a short sprite block (but it's doom, pixels are cool

)
-Solution:hm, use a low res sprite block for low resolution and a high resolution sprite block for a high resolution display
Gzdoom is already using sprite texts? if yes then idk what could cause the lag.
Maybe on the case like loading a map with 1000000 unknown textures, the messages could be generated just on a string file, and when someone open the console it would just convert all that strings to spriteblock. But maybe, this is how things work, so idk...
Hmm, does G/Zdoom render the game part where the console window is or does it only render what you see? ex:first the game render all the scnene, then the console is rendered upon that scene, or G/Zdoom only render the scene where it will be viewed, saving some time.
spoiler example
Spoiler: I may take more time to explain it better, I'm sleepy now :S
* = console area
. = rendered game area
=====
=****=
=....= gzdoom would only render this tiny area and not the full window, so the console area wouldn't overwrite the top screen
=====
[quote="Gez"][quote="ibm5155"]Text rendering is freaking slow, idk how is it made but if it's not this way, I would sugest doing a sprite rendering instead of text.
I did a SDL console, and the text rendering method was so slow that it would be useless to make a console game, so I did a test with a spriteblock, and I rendered each letteras a image, and boom, I got 1000fps :D...[/quote]
Real fonts are extremely complex. They're not just a collection of graphics for each glyph, they are pretty much programs in their own right. Read the articles on [url=https://en.wikipedia.org/wiki/Graphite_(SIL)]Graphite[/url] and [url=https://en.wikipedia.org/wiki/OpenType]OpenType[/url] to get an idea of how much stuff happens under the hood when you render a font properly.
Most of that is overkill for the typical Doom mod, where you don't really need to handle ligatures and nobody will really mind if hyphen, minus sign, em dash and en dash are all the same symbol. Obviously when rendering a letter consists in copying a graphic it's a lot faster than when it consists of running a program that will scan the context of the letter to see how it should be rendered exactly.[/quote]
Indeed, I already saw how complex a real font is, and that's why I just used the good and old sprite block, since my software was to emulate a terminal, it worked quite well.
I can only think some things about the pointed issues.
Indeed, scalling for a high resolution monitor may look bad with a short sprite block (but it's doom, pixels are cool :p)
-Solution:hm, use a low res sprite block for low resolution and a high resolution sprite block for a high resolution display
Gzdoom is already using sprite texts? if yes then idk what could cause the lag.
Maybe on the case like loading a map with 1000000 unknown textures, the messages could be generated just on a string file, and when someone open the console it would just convert all that strings to spriteblock. But maybe, this is how things work, so idk...
Hmm, does G/Zdoom render the game part where the console window is or does it only render what you see? ex:first the game render all the scnene, then the console is rendered upon that scene, or G/Zdoom only render the scene where it will be viewed, saving some time.
spoiler example
[spoiler=I may take more time to explain it better, I'm sleepy now :S]* = console area
. = rendered game area
=====
=****=
=....= gzdoom would only render this tiny area and not the full window, so the console area wouldn't overwrite the top screen
=====[/spoiler]