Pumps and a Bump
Apple released MacOS 10.3.4 today, and it includes a new OpenGL feature called "vertex buffer objects" or VBO for short. It's essentially a method of storing vertex data directly on the video card to eliminate CPU overhead. Apple had implemented a similar extension in the past, called "vertex array range" (VAR) that was essentially a reworking of the Nvidia extension of a similar name. The main difference between VBO and VAR (aside from the API looking fairly different) is that VBO is a cross-platform, ARB-approved way of achieving the same speed-up.
The original Call of Duty code on the PC supported VBO but not VAR. Duane added some VAR code to it while doing the port, so the Mac version of CoD runs pretty well. He also added VBO support to test against, but it ended up performing the same as the VAR path, because according to Apple, they do basically the same thing internally.
KOTOR also supports VBO on the PC. Today I implemented the VBO path on the Mac and ran it under 10.3.4. It made a fairly noticeable improvement in performance. My Mac, a DP/800 with GeForce 3, is well below the minimum specs for KOTOR, so development has been a bit painful. Now with the VBO code turned on, it's actually playable on my Mac (although by no means fast), and performance is competitive with my PC (a 933 P3 with a GeForce 3) for the first time. Naturally, we can't require 10.3.4 for the game so I'll have to write a VAR path before it ships, but I'm grateful to Apple for adding this OpenGL extension to at least make our lives a little easier. Sometime in the future, when our games go 10.3 and up (most are 10.2 and up right now), we won't have to worry about writing VAR code and can just stick with VBO, which will make the development time that much shorter.
Comments
VBO is indeed good news all round :)
Brad, do you have any idea what "Replaceable OpenGL entry points" exactly means? Unfortunately no details have come out of Apple yet.
Posted by: ben b | May 27, 2004 07:32 AM
perhaps 10.3.4 is supposed to help games, but so far all I've seen is that it enables America's Army 2.0a to take down the whole system in about 5 minutes of gameplay (crash-freeze, no force-quit option).
Posted by: edd1e | May 27, 2004 10:23 AM
Did I miss something? What does KOTOR stand for?
Posted by: m | May 27, 2004 11:02 AM
I don't know what that replaceable entry points thing is all about. I first read about it in the release notes. If I were to guess, I'd say it's maybe some driver-level thing that lets vendors override GL calls somehow...?
KOTOR stands for "Knights of the Old Republic". Looking back now, it seems this blog entry was heavy on the acronyms. :-)
Posted by: Brad Oliver | May 27, 2004 12:34 PM
Sounds pretty fab. Time to "fire up" JK: JA again!
Posted by: John Hood | May 27, 2004 03:32 PM
heh. yeah, if you don't know what KoTOR is, you're missing something for sure.
Posted by: deckels | May 27, 2004 06:18 PM
Couldn't you just make the game 10.3 or up only? Save the time encoding right now and stop writing code for 10.2. Honestly, no one plays games on Jaguar, its much too slow. And people who are mac gamers certainly do not play with jaguar.
Jaguar is a thing of the past. Macintosh games are ready for 10.3 only, everything else- like Photoshop, Flash, Illustrator, small apps can all be written for 10.2
Posted by: Gabriel | May 27, 2004 07:08 PM
My attempt at a summary:
* Games which use VAR and VBO run faster.
* Games which use VAR won't see a speed-up by converting to VBO. (How many games use VAR?)
* It takes effort to write VAR code, so if we can port the VBO code from the PC side, and require 10.3.4, then it's easier.
Posted by: Calroth | May 27, 2004 08:03 PM
If they add the VAR code, then they can allow for a larger target audience. There are still 10.2.8 owners out there that play games. They may be waiting for Tiger before upgrading their OS. Just like some people skipped 10.2 altogether some people may be skipping 10.3. While it would make life easier if everyone used the latest OS versions, it's not realistic to expect that to happen. So by putting in the extra bit of effert to get the game running in 10.2.8, you get more potential sales.
Posted by: a2daj | May 28, 2004 01:20 AM
Just curious, but what other OpenGL APIs are available on the PC side of the fence that aren't yet available on the Mac side? Are there alot of them? Would it help speed up ports and development?
Posted by: Mike | May 28, 2004 06:30 PM
Also, what about pixel shaders? How come there is only 1 game on the mac that uses them, and tons on the PC side?
Posted by: owzer | May 29, 2004 12:14 AM
So for those of us with 10.3.4, what difference will we get from changing cfg settings like these from CoD?
seta r_vbo_interleave "0"
seta r_vbo_paranoia "0"
seta r_vbo_smc_static_draw "1"
seta r_vbo_stream_draw "1"
Posted by: Enrique De La Huelga | June 1, 2004 11:17 AM
VBO is not enabled in CoD 1.3, so you shouldn't see any difference by tweaking those settings. CoD does implement VAR support, so turning on VBO support at this point won't add much other than a sense of completion. ;)
Posted by: Brad Oliver | June 1, 2004 08:45 PM