Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: Shaders or VBOs for point clouds?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2008
    Posts
    20

    Shaders or VBOs for point clouds?

    Hey guys,

    So I have a code that plots a bunch of points on the screen. They all have position and color associated with them. Currently I'm using VBOs to display them and it works fine. Points are static and all I do is rotate the view around them, zoom in/out and such. What I notice is that when I hit around 3-4 million points I see a big performance hit, so I wanted to see if shaders would be of any benefit.

    I never did any work with shaders so I'm not sure if they would help in this situation. Any clues?

    Thanks.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Shaders or VBOs for point clouds?

    Shaders are instructions applied to data.
    On the vertex side or the fragment side, you might apply less instructions that fixed path, and gain some speed.

    How do you draw your points currently ? STATIC_DRAW ? Blending ? Alpha testing ? Please show some code.
    And your hardware is ?



  3. #3
    Junior Member Newbie
    Join Date
    Jul 2008
    Posts
    20

    Re: Shaders or VBOs for point clouds?

    So I assume I'm doing a STATIC_DRAW. The points are always stationary and don't move in space all that moves is the camera around them. Here is the code on how I draw the points.

    Code :
                    glBindBufferARB(GL_ARRAY_BUFFER_ARB, vboPointCloudID); 
    		glEnableClientState(GL_VERTEX_ARRAY);
    		glEnableClientState(GL_COLOR_ARRAY);
    		glColorPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(12));
    		glVertexPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(0));
    		glDrawArrays(GL_POINTS, 0, 2*numPoints);
    		glDisableClientState(GL_COLOR_ARRAY);
    		glDisableClientState(GL_VERTEX_ARRAY);
    		glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
    		glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);

    As far as the hardware on the laptop I'm running it I have a Nvidia Quadro NVS 135M

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Jan 2007
    Posts
    964

    Re: Shaders or VBOs for point clouds?

    Try breaking your draw into smaller batches. The exact size of each smaller batch is something you'll need to experiment with, but start at maybe 50,000 per batch and go up from there.

  5. #5
    Intern Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Shaders or VBOs for point clouds?

    Quote Originally Posted by metalac
    Hey guys,

    So I have a code that plots a bunch of points on the screen. They all have position and color associated with them. Currently I'm using VBOs to display them and it works fine. Points are static and all I do is rotate the view around them, zoom in/out and such. What I notice is that when I hit around 3-4 million points I see a big performance hit, so I wanted to see if shaders would be of any benefit.

    I never did any work with shaders so I'm not sure if they would help in this situation. Any clues?

    Thanks.
    I can draw easily 4 Millions of points with a fps over 30 using vbo's and points. What graphic card are you using?

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2008
    Posts
    20

    Re: Shaders or VBOs for point clouds?

    So I just tried drawing 50k at a time and it didn't seem all that impressive. I'd say slightly better, but nothing spectacular. Might go from 1.5fps to maybe 2fps.

    M//Hax: I got a Quadro NVS 135M. I hope that it should be enough to do what I want it to do. I'm hoping that it will be able to draw 20-30 million points at some time.

  7. #7
    Intern Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Shaders or VBOs for point clouds?

    Quote Originally Posted by metalac
    So I just tried drawing 50k at a time and it didn't seem all that impressive. I'd say slightly better, but nothing spectacular. Might go from 1.5fps to maybe 2fps.

    M//Hax: I got a Quadro NVS 135M. I hope that it should be enough to do what I want it to do. I'm hoping that it will be able to draw 20-30 million points at some time.
    That's a mobile quadro...I don't know if it's going to be able to do it. I'm using a Quadro FX 580, and i can easily draw 10Mils points. I never tried over that, but it would probably work. Maybe something is wrong in your VBO as well! I used my program on a pc with an onboard graphic card and it could run at 11 fps with 2 Mils points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •