Console Text Scaling

Moderator: GZDoom Developers

Gez
 
 
Posts: 17945
Joined: Fri Jul 06, 2007 3:22 pm

Re: Console Text Scaling

Post by Gez »

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 :D...
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.
mdmenzel
Posts: 10
Joined: Tue Mar 03, 2015 2:58 am

Re: Console Text Scaling

Post by mdmenzel »

I agree, text rendering is non-trivial. When viewing the console (especially right after loading doom), one has to deal with the possibility of showing text involving the operating system (ie file paths) and that implies Unicode support where special characters may be important.
User avatar
ibm5155
Posts: 1268
Joined: Wed Jul 20, 2011 4:24 pm
Contact:

Re: Console Text Scaling

Post by ibm5155 »

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 :D...
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 :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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Console Text Scaling

Post by Graf Zahl »

ibm5155 wrote: 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...
That's indeed how things work. But all that text needs to be handled before it's written into the console buffer. And that takes time. The old console code started to choke after less than 1000 messages, at least the current one is fast enough so that a larger number of startup errors doesn't mean minutes of waiting - and then missing most of the errors because they were already flushed out of the buffer.
User avatar
Nash
 
 
Posts: 17497
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Console Text Scaling

Post by Nash »

Already [added]
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”