Realtime problem

hi, my name is Carlos and i have a curious problem

I’m developing a game with sdl, lua and opengl and i have a problem with
the usage of the cpu in windows XP

my game is a collection of models, when i dont see any model i have 42
fps and 10% of cpu used,
this 42fps i read that is normal because the monitor is 85Hz / 2 = 42fps
(the doublebuffer and the assyncronous blits, i dont know more
explanation, but this is a secondary problem, someone know how to make
more fps?).
ok, but my real problem is when i see all models i have 18 fps and the
cpu is in 10% too,.

Why i can obtain more fps using more cpu?
How can break the limit of 42fps (refresh rate / 2)?
and perhaps this is more opengl-question: i only represent 1.440.000
faces (triangles, not triangles-strip), with vertex-buffer, using all
textures units. Can i make better?, another extension to draw objects
more quickly?

Thanks for your time and for this lib
Carlos

(and sorry for my school-english :P)

Carlos Rodr?guez wrote:

hi, my name is Carlos and i have a curious problem

I’m developing a game with sdl, lua and opengl and i have a problem with
the usage of the cpu in windows XP

my game is a collection of models, when i dont see any model i have 42
fps and 10% of cpu used,
this 42fps i read that is normal because the monitor is 85Hz / 2 =
42fps (the doublebuffer and the assyncronous blits, i dont know more
explanation, but this is a secondary problem, someone know how to make
more fps?).

It seems that vsync is enabled. You should disable it if you want more
fps (this is a driver specific issue, there are no generic instructions
for that). But your fps will remain in the 42-85 range.

ok, but my real problem is when i see all models i have 18 fps and the
cpu is in 10% too,.

Why i can obtain more fps using more cpu?

You can’t : your video card seems to be the limiting factor for your
program. So the cpu is only working 10% of the time. Your free cpu
should be used for something else like playing sounds / a very smart AI…

How can break the limit of 42fps (refresh rate / 2)?
and perhaps this is more opengl-question: i only represent 1.440.000
faces (triangles, not triangles-strip), with vertex-buffer, using all
textures units. Can i make better?, another extension to draw objects
more quickly?

Looking at the number of faces you use, you’re clearly transform
limited. 1.440.000 faces means three times as much points (4320000
points). Even if you use vertex buffer, this is a lot, so you’ll have to
resort to techniques that reduce the number of points you send to the
video card :

  • mesh simplification (simplify your object geometry so that it contains
    less points/faces)
  • progressive mesh (similar to mesh simplification, but display a
    different version of your object depending on how visible it is)
  • triangle stripification (turn your GL_TRIANGLE into GL_TRIANGLE_STRIP
    to share points between triangles, I usually get a 0.5 reduction factor
    in the number of points)
  • frustum culling, especially hierarchical frustum culling techniques
    are very effective to remove some of the points.
  • occlusion culling (removing objects within the view frustum but hidden
    by other objects), can be effective too.

Stephane