Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Freetype/GL/VBO/shaders


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 02 September 2011 - 09:28 AM

Hi Folks,


You might be interested in the following code that allow to load/render freetype fonts using a single vertex buffer:

http://code.google.com/p/freetype-gl/


There are a lot of examples showing subpixel precision, zooming using distance fields, etc...

Posted Image
Posted Image
Posted Image


Nicolas

Sponsor:

#2 Nicolas Rougier   Members   -  Reputation: 164

Like
2Likes
Like

Posted 22 September 2011 - 03:47 AM

Just added a makefont example that allows to generate a header file with all relevant font information (texture + glyphs description) such that it can be used without freetype.
(see demo-makefont.c)

Nicolas

#3 Neilo   Members   -  Reputation: 290

Like
0Likes
Like

Posted 22 September 2011 - 04:26 AM

Looks good. I'll give it a try.

#4 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 23 December 2011 - 01:54 PM

Hi,

Some update on freetype-gl with a code cleanup to reduce inter-dependencies to a minimum. The only required files are now texture-atlas, texture-font and vector.


Nicolas

#5 Yours3!f   Members   -  Reputation: 1425

Like
0Likes
Like

Posted 24 December 2011 - 08:28 AM

How is its performance?

I tried to make a font library similar to this using 1 VBO and 1 texture, but it still didn't perform well because of the batching, that could be clearly shown through gdebugger.
I packed every glyph into a big texture, and I created a VBO for all the characters and I drew them using glDrawRangeElements().

#6 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 26 December 2011 - 01:37 AM

What do you call batching exactly ?
Concerning performances, there is a benchmark demo that measure time to display the vbo versus time to create/upload/display it.


Nicolas

#7 Yours3!f   Members   -  Reputation: 1425

Like
0Likes
Like

Posted 28 December 2011 - 10:38 AM

What do you call batching exactly ? Concerning performances, there is a benchmark demo that measure time to display the vbo versus time to create/upload/display it. Nicolas


I call batching when you send your vertices to the GPU for rendering (i.e draw calls). Obviously you wanna send as many vertices as you can with as few draw calls as you can. Now in my case I send 6 vertices / draw call (drawing a letter).

I tried out the benchmark demo, and I could see the same performance issue. If you uploaded the text every frame it was like ~80FPS, and if you uploaded only once and drew the whole text with only one draw call, then it was ~500FPSm, which should be the ideal case. But what do you do when you have to display text that changes all the time? So I thought about it, and I realized that it would be ideal to split the rendering to "static" and "dynamic" text. This way one could preserve most of the FPS without the restrictions of either techniques.

#8 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 07 January 2012 - 04:59 AM

Some new update with some glyph outline demos:

Posted Image

Posted Image

#9 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 06 March 2012 - 12:38 PM

Some update with ansi sequence parsing (like in an ansi terminal).
All screenshots at: http://code.google.com/p/freetype-gl/

Posted Image

Nicolas

#10 RobinsonUK   Members   -  Reputation: 108

Like
0Likes
Like

Posted 07 March 2012 - 02:25 AM

This is fantastic. I need to add FreeType font rendering to my engine at some point. Thanks for this. :P.

#11 l0calh05t   Members   -  Reputation: 977

Like
0Likes
Like

Posted 10 June 2012 - 05:52 AM

Looks neat, but what happens if the texture atlas is full? Is there any way to discard old glyphs that are no longer necessary (without discarding all glyphs) to make room for new ones?

#12 Nicolas Rougier   Members   -  Reputation: 164

Like
0Likes
Like

Posted 14 August 2012 - 06:59 AM

Some updates on freetype-gl.

There is now a gl-3.0 branch that will hopefully be the main branch after testing.


Nicolas

#13 FireInDark   Members   -  Reputation: 148

Like
0Likes
Like

Posted 14 August 2012 - 09:28 PM

great job




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS