Should I move to VBOs? [Resuelto]

Hey folks. I’ve been working on a game for a long time now. I made it using immediate rendering. It’s a simple display, drawing 612 quads for the tiles (as long as there is something to draw at all), and quads for whatever other characters there are milling about. It runs at 60fps with the v-sync, and does so smoothly even on my old laptop (which is 5 years old… but does have a dedicated graphics card).

Seeing as how there is so little stress (since I see people complaining about how their millions of vertexes are only chugging along) in my game, is there any reason at all for me to rewrite the whole thing using VBOs? I’ve been working on it the past few days, but I’m not a hardcore programmer and I’m running into issues.

Thanks in advance for the opinions.

No.

Succinct. Thank you.

EDIT - I decided to go with the VBOs. With two clicks and a copy/paste I solved the major problem that was making me rethink.

I’d say “yeah, why not” as you’ll be using the API as properly intended, it’s future proof, architecturally correct, and fun to learn :slight_smile:

Cas :slight_smile:

I would emphasis the future proof aspect. I can’t see immediate mode staying around much longer really. Well not without falling back to some unaccelerated legacy mode.

Depends if you’ve got more interesting/important things to do on the project. It’s not what I’d call a priority.

Kev

I had an odd experience switching some stuff over from immediate mode to VBOs recently. Huge speedup on my PC, but seriously, horribly slow on two different macbooks (one mine, one somebody else’s). Much worse than immediate mode.

Switched to vertex arrays, which ended up being almost as fast VBOs on the PC and worked fine on the macs, too.

I suppose I was mucking up something with VBO’s, but it’s hard to see what - the switch to vertex arrays uses 99% the same code path, since the usage for both is so similar. And it worked well on the PC.

I don’t advise you to use immediate mode anyway as it might become poorly implemented in the future. Rather use at least vertex arrays and VBOs but avoid mixing them. I agree with princec.

I guess this can be closed. I moved to VBOs already :slight_smile:

As simple as it may sound you may look into DisplayLists.

I have a program that reads in 3DS graphics files and I implemented 4 rendering modes: Immediate, Display Lists, Vertex Arrays and VBOs. I found the following speed relationships/rankings between these modes:

[tr]
[td]Mode[/td]
[td]Setup[/td]
[td]Rendering[/td]
[/tr]

[tr]
[td]Immediate[/td]
[td]1 (best)[/td]
[td]4 (worst)[/td]
[/tr]

[tr]
[td]Display Lists[/td]
[td]3[/td]
[td]1 (best)[/td]
[/tr]

[tr]
[td]Vertex Arrays[/td]
[td]2[/td]
[td]3[/td]
[/tr]

[tr]
[td]VBOs[/td]
[td]4 (worst)[/td]
[td]2[/td]
[/tr]

The display lists had the cost of setup that was generally minor but it had the fastest rendering…for one model I had rendering times of 0-15 milliseconds, while in Vertex Arrays and VBOs it was 45-60 milliseconds, and in Immediate mode it was 120 milliseconds.

The downside is that displaylists are locked in to displaying their content, so if it changes (or your window reinitializes) then you need to recreate the list. The same applies to VBOs…you have to rebind and that has a little cost to it. Vertex Arrays and Immediate mode have no cost to reinitialize.

The rendering surprised me that using display lists was much faster than VBOs or Vertex Arrays. I guess I might be able to combine displaylists and vertex arrays/VBOs but I’m not sure…that possibly would be the optimal solution.

Anyway, look into display lists as they may be more useful than you initially thought - I did and it improved my performance significantly.

One MAJOR CAUTION I have with VBOs is that they are apparently not well implemented on Mac OS and as a result you will have a huge slowdown in their initial creation. For the example model I used it took about 1 second to create/bind the VBOs on a PC but 120 seconds (2 minutes!!!) to create/bind on a Mac.

It depends on the implementation of display lists in the drivers. When static VBOs are well implemented, you get the same performance than a smart use of display lists.

ahh, good info.

I suspect the same applies to the implementation of the VBOs in the drivers because I’m having heap memory issues and crashes when switching from immediate mode/display lists mode to using vertex arrays/vbos. I run out of memory on the first rendering call and the application crashes on a computer using an onboard Intel Graphics card…sigh, kind of disappointing but nothing I can do about it.

What is the exact error message or trace? VBO using direct NIO buffers mainly consumes direct memory, only a very little memory on the heap. Intel Graphics cards are unfortunately very bad, their support of VBO is particularly bad on those labelled “OpenGL 1.5 ready”, they have serious problems of performance on PBO too.