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: Adjust GL_POINTS size

  1. #1
    Intern Newbie
    Join Date
    Jul 2012
    Posts
    41

    Adjust GL_POINTS size

    To adjust GL_POINTS size i'm using command
    Code :
    glPointSize(size);

    But the size of it is limited. Is there possibility to increase max possible GL_POINT size?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,220
    glEnable( GL_PROGRAM_POINT_SIZE ) and then set gl_PointSize in the vertex shader. On NVidia at least, you can get point sprites the size of the screen with this. The spec says gl_PointSize is clamped to implementation specific limits. Seems on any recent NVidia GPU, if there are any limits, they're pretty big. Also, they cull as quads, not infinitely small points, which while it violates the spec, is more useful behavior.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,215
    Max point size is controlled by your graphics hardware, not by OpenGL or your program, so if your hardware doesn't support points large enough then you're going to either (a) buy new hardware, or (b) find an alternative solution that doesn't involve using points.

    In the latter case you could draw textured quads at the appropriate size - just use a texture image of a filled circle, billboard it, and draw. There are many options available for reducing the vertex submission overhead with this approach, but you'll need to give more info about what you're trying to do. The fact that you need points at varying sizes some of which may be bigger than the max hardware point size suggests something like a particle system, but that's just guessing.

  4. #4
    Intern Newbie
    Join Date
    Jul 2012
    Posts
    41
    I'm trying to make painting app. And opengl draws points wherever mouse is pressed or dragged. Mouse action's location is being registered and sended to mutable array, then from mutable array its copied to vertex array from witch points are drawn. Vertex array is being redrawed whenever new mouse location is being added to mutable array. So I'm not sure if its even possible to use quads. I tried but try wasn't successful.

    P.S.

    Dark Photon, your suggested solution is not working. I'm programming on mac, and did the fallowing:

    Code :
        glEnable(GL_PROGRAM_POINT_SIZE_EXT);
        glPointSize(1000);

    (GL_PROGRAM_POINT_SIZE_EXT is being used because Xcode says that GL_PROGRAM_POINT_SIZE doest exist) but point's size didn't changed. Stayed like it would be set to:

    Code :
       glPointSize(65);
    Last edited by hockeyman; 07-12-2012 at 06:36 AM.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    hockeyman: Dark Photon specifically said you're supposed to set the point size inside a shader through writing to gl_PointSize. glEnable(GL_PROGRAM_POINT_SIZE) and using glPointSize() won't get you far. If you're not using shaders you're not supposed to enable program point sizes.

    Quote Originally Posted by hockeyman
    So I'm not sure if its even possible to use quads. I tried but try wasn't successful.
    How did you try. Show us some code.

  6. #6
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    Quote Originally Posted by hockeyman View Post
    (GL_PROGRAM_POINT_SIZE_EXT is being used because Xcode says that GL_PROGRAM_POINT_SIZE doest exist) but point's size didn't changed. Stayed like it would be set to:
    GL_PROGRAM_POINT_SIZE should be available in OpenGL 3.2 on the Mac (you're using a Mac, right? Xcode etc. or are you talking about OpenGL ES?), maybe you have a OpenGL 2.1 context? Or you you want a 2.1 app?

  7. #7
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    Quote Originally Posted by hockeyman View Post
    Code :
        glPointSize(1000);
    You can only render point sizes from ALIASED_POINT_SIZE_RANGE[0] ... ALIASED_POINT_SIZE_RANGE[1].
    (Or SMOOTH_POINT_SIZE_RANGE[0] ... SMOOTH_POINT_SIZE_RANGE[1], if you enable point smoothing.)

    The upper limit is typically around 64, so asking for 1000 is not going to work.
    You can see exactly what are all of the limits are across all Macs (across several OS versions) here:
    https://developer.apple.com/graphics.../capabilities/


    If you want to draw something that looks like a point but larger than the point limit, draw a quad instead.

Tags for this Thread

Posting Permissions

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