OpenGL Vertex Buffer Object (vbo) experiment
Moderator: Moderators
OpenGL Vertex Buffer Object (vbo) experiment
I've made an attempt to using OpenGL Vertex Buffer Objects to render meshes in ZGE. This is supposedly the fastest way to send geometry to the graphics card.
However I get varying results. Vbo's seem to be faster. But only when I render very large geometry. With smaller meshes I get the same or even less frame rate compared to the older method using vertex arrays.
Please try the attached example (containing two exes and one zgeproj).
I render two meshes: one with 50k triangles, the other with 80k.
On my computer (nvidia card) I get the following frame rates:
40 with vbo
15 without
I'd be interested to hear what rate you get.
However I get varying results. Vbo's seem to be faster. But only when I render very large geometry. With smaller meshes I get the same or even less frame rate compared to the older method using vertex arrays.
Please try the attached example (containing two exes and one zgeproj).
I render two meshes: one with 50k triangles, the other with 80k.
On my computer (nvidia card) I get the following frame rates:
40 with vbo
15 without
I'd be interested to hear what rate you get.
- Attachments
-
- vbo_test.zip
- (106.55 KiB) Downloaded 571 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
tests,.
without vbo I get 30-29 and it runs very smoothly,. the fps alternates between 30 and 29 continuously,. every second or so,.
with vbo I get a solid 30 as long as the mouse is outside the window,. however as soon as I MOVE the mouse over the window it drops to 29 and there is that visual frame stutter,. (I remember having that same problem with ZGE in the past, I don't recall how it was resolved) if the mouse is left still while over the window the fps goes back to 30 and the visual glitch stopes,. so only while the mouse is moving,. .
hope that helps,.
with vbo I get a solid 30 as long as the mouse is outside the window,. however as soon as I MOVE the mouse over the window it drops to 29 and there is that visual frame stutter,. (I remember having that same problem with ZGE in the past, I don't recall how it was resolved) if the mouse is left still while over the window the fps goes back to 30 and the visual glitch stopes,. so only while the mouse is moving,. .
hope that helps,.
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Re: lol
Haha, indeed!jph_wacheski wrote:kjell is running a testing lab!

Good report Kjell!
Ok that means I'll leave the VBO-functionality and include it in the 1.9.6b soon. And if no problems arises we can keep it for next release.
By the way Jph, what video card do you have? Mine is a GeForce Go 7400.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
49 without -> 130 with VBO
yep quite a big difference!
Ville, before you proceed, I would ask you read this pdf: http://www.khronos.org/registry/gles/sp ... 2.0.23.pdf
It's the file speaking about the main differences between OpenGL 2.0 and OpenGL ES 2.0:
chapter 2.6-2.7. Is this VBO a major step towards a possible port of ZGE to OpenGL E.S?
since I'm becoming quite interested in it: the Pandora handheld will only support OpenGL ES and getting ZGE working on it might be a really good thing. 
Plus, don't forget about the IPhone


Ville, before you proceed, I would ask you read this pdf: http://www.khronos.org/registry/gles/sp ... 2.0.23.pdf
It's the file speaking about the main differences between OpenGL 2.0 and OpenGL ES 2.0:
chapter 2.6-2.7. Is this VBO a major step towards a possible port of ZGE to OpenGL E.S?


Plus, don't forget about the IPhone



In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
Ok thank you... I got confused by vertex array and vertex buffer.
While we are on topic, what is the worst thing that has to be changed in order to get ZGE being ES-compliant? Missing fixed-pipeline functionality?
While we are on topic, what is the worst thing that has to be changed in order to get ZGE being ES-compliant? Missing fixed-pipeline functionality?
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
Well I haven't studied the ES-specification much so I can't really say.
At first I thought ES did not allow floating point values at all (only fixed point) and this would of course be a big hurdle. But now it seems like it does support floats after all. Hardware manufacturers have some freedom in what level of ES support they implement, so I'm sure there are devices that do not support floating point at all.
That spec you linked to suggests that the model of coordinate transforms using matrices with glPushMatrix etc. is not supported. But I've seen it supported in ES examples on the net, so I'm not sure what that means. ZGE use this functionality.
Immediate rendering with glBegin/End is not supported. This means that render code in ZGE apart from RenderMesh (fonts, sprites, net and particles) needs to use vertex arrays also. But this is a good idea to change in the main version of zge because it will probably increase performance in normal GL operation.
At first I thought ES did not allow floating point values at all (only fixed point) and this would of course be a big hurdle. But now it seems like it does support floats after all. Hardware manufacturers have some freedom in what level of ES support they implement, so I'm sure there are devices that do not support floating point at all.
That spec you linked to suggests that the model of coordinate transforms using matrices with glPushMatrix etc. is not supported. But I've seen it supported in ES examples on the net, so I'm not sure what that means. ZGE use this functionality.
Immediate rendering with glBegin/End is not supported. This means that render code in ZGE apart from RenderMesh (fonts, sprites, net and particles) needs to use vertex arrays also. But this is a good idea to change in the main version of zge because it will probably increase performance in normal GL operation.