Tuesday, April 17, 2007

Fontastic

After some research and help from the good people at GameDev I have found out there there is in fact no problem with the Vertex Arrays or VBO's. The problem lies in the Font Object.

A few days ago I wanted to show the Camera Position and Rotation so I quickly followed a Font Tutorial in order to display this info on screen. I didn't really pay attention to what I was doing as I planned on rewriting this anyway so I fell victim to Copy and Paste.

Upon review I found that the font class used switches from 3D to 2D mode every time a string is rendered, so when I was rendering 6 lines of text this involved 6 Switches to 2D and 6 Switches back to 3D. When I changed this so that it switches to 2D, renders all text and then switches back to 3D I did find some improvements.

Running on a lower end system

Os : Windows XP Pro SP 2
CPU : Intel(R) Pentium 4 3.00GHz
GPU : Intel(R) 82915G/GV/910GL Express Chipset Family (Driver Version 6.14.10.4410)
Ram : 1GB

I get the following results

107fps when rendering in a nested Loop.
128fps when rendering using Vertex Arrays.
130fps when rendering using VBO.

I will now add in Index Buffers and see what results I get, as well as running on my home computer which has a good graphics card.

No comments:

Post a Comment