flat assembler
Message board for the users of flat assembler.

Index > Windows > wgl font alternative

Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 01 Mar 2009, 22:06
I have written an alternative to the wgl bitmapped font.
To compare the output quality and rendering speed i have
implemented a standard wgl bitmapped font demo and also
a custom font demo (which uses a custom font texture).
Both versions render the characters 'a' through 'z' and also
display the current rendering speed (frames per second).
On average my version renders a 50 character string 10
percent faster than the standard wgl version.
This has been tested on a stock pentium 4 with winxp2
Note that some video cards limit the maximum refresh rate.
Ex: If both versions run at 60 fps, then its being clamped.
I can give information about how to view the font image
if you would like to view the characters in the file.
As always, any comments are greatly appreciated.


Description: Latest Version
Download
Filename: myfont.zip
Filesize: 32.81 KB
Downloaded: 458 Time(s)


_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.


Last edited by bitshifter on 25 Jan 2010, 20:48; edited 4 times in total
Post 01 Mar 2009, 22:06
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 01 Mar 2009, 22:41
The myfont file can be opened RAW: 256x128x8bit. You can use IrfanView or HexEd or whatever Smile

Amazing how bitmap fonts can be optimized Razz 58.4% better for me 231 vs. 366 FPS
Post 01 Mar 2009, 22:41
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 01 Mar 2009, 22:49
For me it's 4577 vs. 6011.
Post 01 Mar 2009, 22:49
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 02 Mar 2009, 00:39
I suppose I'm the first in reporting a clamped result Smile

85 fps vs. 85 fps (my refresh rate is 85 Hz).
Post 02 Mar 2009, 00:39
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 02 Mar 2009, 01:28
Madis731: You're right on the money with that one!
I use photoshop to play with the images.

Obviously my pc is junk since im getting 110/120.
Also my stock celeron 345 shows the same result.
I spend all my time optimizing just to keep up Sad
Post 02 Mar 2009, 01:28
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 02 Mar 2009, 06:06
btw, my laptop has X3100 graphics - I think I should also try a discrete one, like Thomasz did...
Post 02 Mar 2009, 06:06
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 10 Apr 2009, 11:04
Hey Tomasz, what are you running to get those kind of numbers?
Is this some kind of alien technology?

Anyway, i think i will add this new font code to my fps camera demo so people can see what kind of framerates it renders for them.

Find latest version here...
http://board.flatassembler.net/topic.php?t=9262

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 10 Apr 2009, 11:04
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 11 Apr 2009, 10:04
Interesting results:
1) I couldn't agree that the video card was to be blamed (for the FPS clamp) so I headed for the Control Panel:
http://nap.koduleht.net/Madis/cache/VSyncOff.png
2) Your framerate seems to be CPU-limited so actually this example shows CPU-optimization:
myfont.exe :: 4570
wglfont.exe :: 5970

I did some further testing and when I modified your image to use only upto symbol 'N', I discovered the FPS went up to ~5000. I'm not sure what calculations are the toughest, but I'm still very limited to CPU (always at 100%). What if we could batch this font on 2048x1536 screen. 128*96 characters would be 12288 altogether. If that were a GPU task, we would see a heavy drop in the CPU-usage.

Its a GTX 260 (the newest generation) and its a Server 2008 x64 OS with Core i7 920 CPU @ 2.66GHz.

Maybe they updated the GPU?
Maybe they updated the OpenGL? (Or just their font?)
Post 11 Apr 2009, 10:04
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 11 Apr 2009, 10:31
Hi Madis731
Interesting results indeed.
It seems opengl may have finally optimized the bitmap rasterizer.
This means im gonna have to re-open my bag of tricks and rethink them.
Anyone else is welcome to post their results here...

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 11 Apr 2009, 10:31
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 11 Apr 2009, 10:56
myfont.exe 77 frames per second
wglfont.exe 108 frames per second
P4 2.66GHZ , XP PRO, ATI Radeon 9600 PRO Razz

_________________
Nil Volentibus Arduum Razz
Post 11 Apr 2009, 10:56
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 11 Apr 2009, 18:57
On my
Quote:

Vendor: ‎AuthenticAMD

Model name: ‎AMD Duron(tm)

Cpuid family: ‎6

Model: ‎7

Model stepping: ‎0

Performances
Frequency (MHz): ‎1102.623

Cache size: ‎64 KB

I am only getting 9-10 fps on both demos Sad .
Post 11 Apr 2009, 18:57
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 11 Apr 2009, 19:49
Hey Dex, you didnt run them in the zip did you?

I just ran it on my mom's pc and got 18fps on both demo's. Crying or Very sad
Quote:
INTEL(R) GRAPHICS REPORT
Operating System: Windows NT* 5.1.2600
Physical Memory: 126 MB
Processor: x86 family 6 Model 8 Stepping 10
Processor Speed: 897 MHZ
Accelerator In Use: Intel(R) 82810 Graphics Controller
Current Graphics Mode: 1024 by 768 True Color (75 Hz)

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 11 Apr 2009, 19:49
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 12 Apr 2009, 01:48
No, i unzipped them first then run the programs
Post 12 Apr 2009, 01:48
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 25 Jan 2010, 20:49
I have fixed a bug in my code and uploaded a new version.
Post 25 Jan 2010, 20:49
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.