Toonists Tampered Apricot Build with VBOs (TM) [NOW WITH WINDOWS BUILD]

So! I decided to try to optimize the drawing code a bit by implementing VBOs (Vertex Buffer Objects) to the BGE.

So what are VBOs? The old method of rendering is to pass the data to the GPU on every frame and the GPU does its thing and brings stuff to the screen. Now VBOs attemp to overcome the concept of passing data to the GPU and instead, STORE data INTO the GPU for fast data access.

This should make things render faster.

However I’m having some mixed results with my comp (sometimes faster, sometimes slower, sometimes neither…) so I need a bit of help with testing. So if anyone has the time to test my build. I would be very grateful ;). If possible, do some bench marking with different scenes (scenes with over 200K triangles are optimal for testing) and post your hardware specs and benchmark results into this thread. Also please do not enable the display lists since they override the VBOs.

NOTE: VBOs work only on hardware that supports them. (OpenGL 2.0 support I think…)

Also please post any BUGS!




Here is a little test scene:

Here is the patch for compilers:


Are you going to submit the patch to the patch tracker?

If you can single out what cases they are faster in, you could code things so they automatically go into effect only when they are faster. I would think you learned a lot about coding with the old BlendX project (before Brecht, Ben, and others dramatically improved BGE).

Also can you implement this for the 3D view as well? As speeding up 3D view drawing is critical for things like sculpting and assembly of complex scenes.

Yeah I learned a lot ;). VBO should be faster for rendering in any case so they should be used at all times. Updating VBO data might be a bit slow but the rendering should make up for it.

I was hoping to submit this patch to the tracker once I was more sure that it actually works as its supposed to. If the hardware supports VBOs, they are enabled by default, so I really want them to work correctly.

3D viewport… I’m not that familiar with the drawing code but I could take a look 8|. The caveat is that whenever somebody is editing the mesh, the VBOs would have to be turned off for the mesh being edited. The others could keep rendering happily though. And when sculpting, the VBOs could be on all the time, atleast I think so. ( ! big plus!)

Hello Toonist,

Thank’s for your work for the BGE. I will test it soon.



Sounds good… I can only test windows builds… i would suggest making some demo test scenes for people to use so you can bench mark it correctly. .eg. kinda like what they did in apricot… but not as complicated?

Bug fix! Alpha sort crashed if the model wasn’t animated. Fixed now :wink:

New dls:

Linux 64-bit:

Updated patch submitted to the tracker:

here is a unoptimised win32 build i made with cmake and visual studio 2008 professional
without ffmpeg, player, quicktime, verse

i might have done something wrong when patching the build because it´s my first time building a build with a patch, but i don´t think it is

the blender 3d viewport with glsl seems to work fine but when i try bge it crashes very often

hope this helps :o

I think I found the bug which is causing the crashes. Off to fix ->

EDIT: it should be fixed now, uploaded a new windows build for everyone to try, thanks joergi for pointing the bug out! :wink:

EDIT2: Linux 64-bit build and patch updated.

AWESOME! :eek:

here is the first test on linux 32 ubuntu 8.04 with latest patch bugfix001
nvidia 7600 gt athlon 3000+

761856 tri 1 shader (no textures)
enable all frames
generate display list
glsl materials

with vbo patch: 169 fps
no patch: 13 fps

i tested the complex scenes with lot of shaders that have textures applyed (spec, normal, color, shadowmaps) the result is exactly same.

Wow, thats massive. With my GF7400Go I get 112 fps with 150K triangles. Still nice though. Without the vbos I get only 52fps. =D

If the speedup is that much Brecht should commit the patch and have that in when Yo Frankie is released, it’ll only make good for those with computers that aren’t high end. Even though users on high end computers will benefit just as much too.

toonist, you planned release an fbo patch for bge, because for now the 2d filters is extemely slow (or fbo is in bge yet just not optimized?)

Wow, good job! I’ll get my new computer in two weeks (this one is too old for testing :(), I have some some ideas that might now be possible to do :smiley:

Lemme check…

Nope, FBOs aren’t used for 2d filters, have to put that on todo list… The shadow maps for shadows are rendered with FBOs though.

Oh, I didn’t notice you were using display lists. They override the vbos. Could you try without display lists?

test with 380928 tri

turn on display list:169 fps
turn off :128 fps
turn off and esc and start again the bge 64 fps and it will be always 64 fps

no vbo patch, on displaylist 13 fps
no vbo patch, off displaylist 8 fps

fast 2d filters rulez! :wink:

hm? “turn off and esc and start again” what do you mean? are the vbos slower the second time you launch bge?

yes, it seems if i load a scene where turned off displaylist (128fps) it will be faster than when i run gbe agan (second launch 64 fps) and third (64fps) will be same as second.

and seems only happend if run fresh blender and run very fist bge with no display list.

You are doing a good thing Toonist, considering how Brecht and Campbell may not touch the BGE code even near as much in the future as during Apricot we’re glad you came in to continue what Brecht started with graphics and optimizations.:slight_smile: