PDA

View Full Version : Ftgl


Nickolei
2002.08.18, 04:14 AM
I've been playing around with FTGL and I'm hoping you guys could give me a few pointers.

Bitmaps can be colored but not anti-aliased.
Pixmaps can not be colored but are anti-aliased.

What about the others? Why would I pick any one above the others?

And is there something special about textures? When I switch to them in the demo it crashes.

OneSadCookie
2002.08.18, 07:24 AM
My personal experience has been that texture fonts are best if you have plenty of VRAM available and are low on transform rate, and polygon fonts are best if you have plenty of transform rate but are low on VRAM. Those two seem to give the best flexibility. They also tend to look better/worse than each other in different situations.

What OS / version of FTGL / version of FreeType are you running that the texture font crashes?

Nickolei
2002.08.18, 02:51 PM
It was just a low memory thing...I pumped up the PPC target and it works fine. Makes sense now with what you say about textures.

As cool as ftgl seems, I think i've made every mistake possible while getting it to work.

henryj
2002.08.18, 07:13 PM
The crash is a bit of a worry. Could you send me a stack trace and I'll try and track it down. Texture fonts only allocate 1 meg at a time which shouldn't be a big deal.

The font type you use is dependent on your application.
Bitmaps are the fastest and use the least memory but the quality is low. They can't be transformed either.
Pixmaps are excellent quality but you can't transform them. The colour is set when the glyph is created which can be a bit tricky.
Texture fonts are as good a quality as Pixmap fonts but if you have limited vram they can be a bit slow. If you have bucket loads of vram they will probably be the fastest. They can also be transformed. They can be a bit tricky to use because most people scale them up too much making them look crap.

The vector fonts, Outline, polygon and extruded, are good if you have a good geometry engine and are texture limited. The down side is the quality. Apart from the outline font they can't be anti aliased, and no, fullscreen anti aliasing doesn't make it any better. Some tesselators don't handle asian fonts too well though the OSX one seems fine.

Nickolei
2002.08.18, 09:56 PM
Before I put a breakpoint at case FTGL_TEXTURE in do_display() and stepped it down ...

it crashed on fonts[current_font]->render(myString);

This was on OS 9 and the memory was set pretty low...somewhere around a meg or two.

Now I can't seem to reproduce it though. Maybe I'm wrong and it wasn't exactly a crash...just quitting because there wasn't enough memory.

The only reason it came up I'm betting is because I had to make the CW project myself and still don't know exactly what I'm doing.

sorry if this doesn't exactly help...maybe you could just throw in a CW project for the demo and this wouldn't even be an issue.

henryj
2002.08.18, 10:20 PM
I don't have code warrior any more so I haven't been able to keep the project up to date sorry. I'm looking for volunteers to keep it updated.

Nickolei
2002.08.19, 05:03 PM
I could send you the codewarrior project once I clean it up a bit.

I'm finally starting to understand how the demo is set up and the conversion between opengl screen units and the BBox() function.

However my other code is set up using a different Projection matrix and I'm having trouble getting both to show up at the same time.

Is it possible to use two Projection matricies like...

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(...)
gluPerspective()

glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

draw my 3d stuff

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho2D(...)

glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

draw pixmap fonts

henryj
2002.08.19, 05:08 PM
Yep, that's not a problem, I do it all the time.


You don't have to use the projection set up in the demo. Feel free to change it. See if you can get it to work using your own projection.