Advertisement

vertex array, display list ?

Started by July 11, 2001 04:20 PM
8 comments, last by penetrator 23 years, 7 months ago
in my terrain engine, i use the following procedure: ComputeVertex(); // which store x,y,z values reading a .raw map greyscale file directly into an array and then: for (y=0 .... { for (x=0 .... { glBegin(GL_TRIANGLE_STRIP); glVertex3f(x,y+1,z); glVertex3f(x,y+0,z); etc... the loop builds the terrain using the information stored previously by ComputeVertex() in an array So ... is this already a good approach or can i speed up things using display lists or vertex arrays ? thanks ! glHorizon_Project

www.web-discovery.net

Well for a start you don''t need the y+0...

Basically, glVertex() is slow and vertex arrays are fast and dynamic. My advice is to use vertex arrays, they can really speed things up, for best results you need to sort your indices to stop memory jumps....etc Display lists are alright, but you can''t change them or perform culling on the data so they are not really suitable for large worlds where this needs to be done.

My engine got about 110FPS with glVertex() and no texture sorting. Then I sorted the textures, and used vertex arrays and organised them nicely and it went about 250FPS. But mines not a terrain engine, but I think the principle''s the same.

FatalXC

Advertisement
I''m just curious how you are getting 250 FPS? In my code I''m limited to my refresh rate because SwapBuffers blocks until the screen is finished drawing. Do you have it on a seperate thread or something?
Thanks,
~S''Greth
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
I imagine he has V-sync turned off.

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---I write code.DelphiGL (http://delphigl.cfxweb.net)
Yeah you have to turn V-Sync off to get frame rates higher than the monitor refresh rate. This should be an option in your video driver setup for OpenGL.

FatalXC
Ahhh, so it''s not a function call I can make then? I''ve been wondering how to get around that for a while now and I''ve never found any function calls or parameters to modify!
~S''Greth
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
Advertisement
hi,
how do i use vertex array, and how can it replace glVertex()? thanks in advance,
shurcool.
damn, 250 fps, don''t you get flicker when you turn off V-sync??

it''''s all about a good time!


-LOKAPUJA-
it's all about a good time!AOLIM name: -LOKAPUJA-
I haven''t noticed any flicker. The monitor still updates at 85hz and there''s no reason for the rendering to flicker when its being updated so fast And all on a GeForce DDR...

cya,

FatalXC
Well, when the frame rate is higher than the monitor refresh rate, then you can get a flicker like effect, which is more noticeble on monitors with a low refresh rate. Since the frame rate is more than twice the speed of the monitor refresh, the swap probably happens during a horizontal synch, so the top half of the image will be from the previous frame, and the bottom half would be from the next frame or something like that. And things might not line up correctly. I''ve seen this effect on a monitor w/ a 60Hz refresh rate. So the higher the monitor refresh rate, and the less that changes between frames, the less of a problem this will be. V-Synch can be a good thing, because there really is no need to run at a frame rate faster than the monitors refresh rate, aside from the kewlness factor of achieving such high frame rates

J.W.

This topic is closed to new replies.

Advertisement