AmzBee's picture

Fast rendering without VBO's

Hey everyone, sorry to make my first post based on a question, but just to let you know I've tried allot of things before reaching
out, I have a bit of a pickle. This morning I started down the path of implementing VBO's to boost the performance of my tile based
engine, I got my head around them, and actually like the neat way the deal with lots of verts at one time, however after getting a
entry point not defined error I realised that I don't even have the ability to use VBO's on this system spec:

Windows XP Machine
ATI Radeon 9200 (applologies for saying GeForce)
2GB DDR-EEC
Xeon 2.4 Dual Core X2 CPU

Now I could go and get my FX5200 out of another XP machine I have, even though it's old, it does support OpenGL 1.5, but the
truth is there are plenty of games that run wonderfully on this machine, and I'm puzzled as why when drawing a 640x680 screen
with 32x32 quads would give me at best 20fps. Is there a more efficient way to stream quads to the graphics card, or should I just
admit defeat and get that FX5200?

Here are a few optimizations that have been made to speed things up:

- Entire maps are not drawn, only the tiles that fall within the screen's region are dealt with.
- Textures are only bound if the texture ID does not match the last id.
- I modified the code, so quads are defined within one set of GL.Begin(BeginMode.Quads) and GL.End()
- Also tried making the tiles 64x64 instead to low the poly count, didn't make much difference.
- Used some advice from a few months ago doing php, and replaced foreach loops with for loops making sure to
provide a int instead of a .Count() to reduce time in selecting regional tiles.

plus a load more which even included reducing the quality of textures etc just to get some more performance out of it, Thanks for
giving this post a read, and I hope someone has a bit of insight into any other areas I could explore, where there is a will there is
a way hey? :P

Aimee.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture
Quote:

GeForce 9200

This card support OpenGL 3.3. Install the latest drivers from nvidia.com and check GL.GetString(StringName.Vendor/Renderer/Version) to ensure you are not using software emulation through Microsoft's drivers.

Other than that, you can build display lists to render multiple tiles in one pass, just like you'd use VBOs (display lists only require GL1.1).

AmzBee's picture

I should have said Radeon 9200, why nvidia saw fit to repeat their card names i don't know. But this is the AGP Radeon 9200, like
the FX5200, one of the last relatively good AGP cards.

Correction: sorry for being daft, i missed the ATI sticker

jrwatts's picture

(nvm, OP updated to indicate a different card)

AmzBee's picture

oh i didnt realise you said about display lists, I read on another forum that there was not much of a performance boost with them, were they wrong?

the Fiddler's picture

Display lists perform on par or better than VBOs for static geometry. Depending on the bottlenecks in your application, this can improve performance from slightly to a quite a bit.

AmzBee's picture

after messing around with some tweeks to the screen to world coords, and trying a new driver, it seems to have fixed everything. Thanks everyone for your replies, I guess this thread could be counted as closed :)

Aimee.

tksuoran's picture

If you use display lists, it may take some effort to figure out how to render only a the visible portion of the map without rebuilding display lists too often. Building a display list per frame is a very bad idea, probably is slower than not using display list at all. Ideally you are not building new lists at all during runtime.

If you have multiple textures for the map, there are couple of things you should consider. These still affect performance even if you use VBO.

First, and ideally, put all textures into a single larger atlas texture. This way you do not need to change texture binding, which can be a costly operation.

Second, you should minimize the times you change the texture binding; Naive tile map rendering typically renders tiles in (x,y) order. To minimize texture bindings you should instead render the tiles in order which all tiles using a texture are rendered in one pass, followed by binding next texture and rending tiles using that texture. But this can be avoided if you can use texture atlas as mentioned above.

martinsm's picture

Try using client side Vertex Arrays. It's very similar to VBO (more or less) except that you need to either uz fixed arrays or GCHandle (with Pinned type) in C# to prevent runtime from moving your arrays around while GPU/driver is using them.