Re: Display problems in Vista
- From: aku ankka <jukka@xxxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 13:36:20 -0700
On Oct 11, 10:34 pm, "John A. Byerly" <jbye...@xxxxxxxxxxxxxxxxxx>
wrote:
But how much computational time is eaten up by telling the system to draw a
red line, 1 pixel wide, from point A to point B?
Not much, processing overhead for a glDrawArrays, glDrawElements and
similar is in class of thousands of clock cycles (not millions, unless
updating something).
Example:
glDrawArrays(...)
If you are using VBO, and you should, this mostly chooses which VBO's
to use (enabled arrays) and creates a packed of data into the command
buffer. Very small overhead. If the data is in GPU local memory, only
the command packet needs to be transfered. If your render states
changed a lot since previous drawing call, this invokes setting
command packet describing the register writes required to implement
the state changes in the render context.
This should amount to the "class of thousands of clock cycles", the
range jumps into millions when you are transfering large amounts of
actual vertex data across the bus. Try to avoid it.
The small overhead adds up quickly. If you really do a draw command
per primitive, you're doing things wrong.
That is what I do, times
10 million. That is my static image. My dynamic image is slightly more
complicated, but not much. I don't use, nor need, shading, lighting,
blending, or fog.
Granted. To me, the question is whether I need all of that powerful
graphics hardware.
For drawing graphics that is usually a good aproach. :)
Does "one draw command" equal one glBegin/glEnd pair?
Yes. If you do that *per line*, no wonder the performance is bad.
GeForce 8800 GTS for example is able to draw tens of millions of lines
at 100+ frames per second. I shit you not.
If you get 10 fps with only few million of lines, you are something
close to 50 times too slow from what this hardware for example could
do.
You might be interested to know about "shaders"; the OpenGL has
extensions for nVidia hardware to generate primitives inside the
graphics processor. The graphics processors these days are
programmable, if you can afford to target for OpenGL 2.0 or 2.1, you
can use this functionality. I don't go in too much detail because I
don't know if you are interested at all.
If so, I am doing
that as much as I can. The lines describing the image are fed to the
viewport and cached in a model class. When the image is completely loaded,
the whole model is displayed in the viewport. That is my static image.
OK; so the static data doesn't change, only the view into the data
changes (eg. you can pan, zoom, rotate etc.) This can be encoded into
4x4 MVP matrix so that part is alright.
I am using display lists. The performance is just too choppy if I don't. I
investigated using vertex arrays, but I can't, due to the information I am
trying to display. To give you an idea of the problem, in some cases, I
have to display a line that is x pixels wide at any zoom level.
I can't
simply store the vertices I use for the thick line (which for the 3D view is
actually a square tube).
To make matters worse, for some parts of the
dynamic display the thickness of the line must be insensitive to zoom, but
in other places it must vary with the zoom. Display lists don't help with
this, but seem to be the best solution for all other issues.
What primitives are you currently using? GL_LINE*, or GL_TRIANGLES..
or..? I don't understand the problem from your description because
what you are doing sounds straightforward. The biggest issue from
technical side is that you might exceed the performance suggestion
limits for number of vertices, but it isn't the critical detail sounds
like you have more serious problems somewhere if 2-4 M lines is ~10
fps.
.
- Follow-Ups:
- Re: Display problems in Vista
- From: John A. Byerly
- Re: Display problems in Vista
- References:
- Display problems in Vista
- From: John A. Byerly
- Re: Display problems in Vista
- From: jbwest
- Re: Display problems in Vista
- From: John A. Byerly
- Re: Display problems in Vista
- From: jbwest
- Re: Display problems in Vista
- From: John A. Byerly
- Re: Display problems in Vista
- From: aku ankka
- Re: Display problems in Vista
- From: John A. Byerly
- Display problems in Vista
- Prev by Date: Re: Display problems in Vista
- Next by Date: Re: Display problems in Vista
- Previous by thread: Re: Display problems in Vista
- Next by thread: Re: Display problems in Vista
- Index(es):
Relevant Pages
|