Optimisation to display points

Hello,

I am making a hurricaine simulator and I need to display around 25million points.
I’ve tried to use Vertex array and display list but it’s very slow


  displist_ = glGenLists(1);

  glNewList(displist_, GL_COMPILE);

    glColor3f(1.0f,1.0f,1.0f);
    glBegin(GL_POINTS);
    for (int i = 0; i < XDIM; i++)
      for (int j = 0; j < YDIM; j++)
        for (int k = 0; k < ZDIM; k++)
      	glVertex3i(i, j, k);
    glEnd();

  glEndList();


  vertices_ = new GLfloat[NUM_ELEM * 3];
  for (int i = 0; i < XDIM; i++)
    for (int j = 0; j < YDIM; j++)
      for (int k = 0; k < ZDIM; k++)
      {
	int pos = (i + j * XDIM + k * XDIM * YDIM) * 3;
    	vertices_[pos] = i;
    	vertices_[pos + 1] = j;
    	vertices_[pos + 2] = k;
      }

  glEnableClientState(GL_VERTEX_ARRAY);
  glVertexPointer(3, GL_FLOAT, 0, vertices_);

How can I render a such amount of vertex?

You’re just one step away from the answer: VBOs.

My graphic card don’t seems to support OpenGL 1.5 I am currently in 1.3.
For the moment with 2.5million points I have 8FPS. Do you think that I will improve that much with VBOs ???

Thx for the reply

What is your video card ? Nividia is know to have very efficient displays lists.
Is your geometry static or dynamic ? VBO will help a lot for dynamic stuff. Display lists can be very good for static geometry.

Unlikely you will do much better with VBO with the card you have.

On what hardware are you working on?

With vertex buffer object memory management is better, this may improve performances, (data can be cached in server memory…)

Are you always looking at these 2.5 million points? If not, try to select only visible ones using an octree for example…

EDIT: ok I am a bit slow. :slight_smile:

My video card is a Radeon 7500 (RV200 QW)
I have only 512Mo RAM but I’ve tried to run it on an other computer wich have 2Go and an Intel 915 but I get the same results.
I am working under Ubuntu 8.10

Yes I am looking at these points.

Hmm, technical questions aside, do you really want to visualize 25Mill points? A typical screen has only like 2Mill pixels…

Maybe it’s better to group the points first in clusters and only render those clusters.

Or put all data points in a 3D texture and use volume rendering.
Just write the 3D-grid data to disk and use an existing volume renderer(i know this old one from my diploma thesis: http://www.vis.uni-stuttgart.de/~engel/pre-integrated/ )

For the brute force approach, maybe it helps to use multiple, smaller-sized display lists?
And try specifying a simple vertex+fragment shader, just to be sure that nothing unnecessary is calculated there.

I think you’re right. I don’t need to display 25M points. But I don’t really know how I can visualize this dataset without loosing information.

Can you tell me more about the 3D texture and volume rendering? I have no idea how I can make a 3D texture with my hurricane dataset.

I will try to group the points in clusters as you told me and see what append.

I m working on a 500x500x100 dataset. For the moment I can render 125x125x25 with reasonable FPS but I think I am loosing too much information.

I see you are working on 3D-grid data already: assuming you have one BYTE per grid cell, just write the whole array binary to disc, and the volume renderer will load it as 3D texture.

Then it will render many semi-transparent planes parallel to your viewing plane, each slice textured with a different cut through the 3D texture.

Hmm, but the Radeon7500 or i915 won’t run der Volume renderer i linked:( And even if, it would be too slow on that hardware.

Hi again,

I’ve found a video of what I want to have.


http://www.vrvis.at/simvis/Isabel/

Does anyone know how is displayed the dataset in this program?

looks like a volume render to me - so a sequence of viewer aligned slices drawn with 3d texture coordinates indexing into a 3d texture.