Results 1 to 7 of 7

Thread: Point sprites not responsive to projection changes

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2005
    Posts
    22

    Point sprites not responsive to projection changes

    In my app the user can adjust the size of the viewport by dragging a box smaller or larger. This in turn calls glOrtho2D with smaller or larger values. I recently decided to try rendering with point sprites, and found that the size of the point sprite didn't scale with the width/height I passed to glOrtho2D, unlike every other piece of geometry I've ever thrown at OpenGL.

    I expected that if I set the glPointSize to be 100, then the point would behave just like a textured quad that's 100 wide, but that doesn't seem to be the case. Is there anyway I can make the points behave this way?

  2. #2
    Guest

    Re: Point sprites not responsive to projection changes

    Point sprite size is governed by a user configurable quadratic falloff equation but is hindered by a relatively small maximum size (glGet* with GL_POINT_SIZE_MAX), not to mention viewport edge clipping issues. In short, it's not likely to behave the way you apparently want it to.

    Consider the use of billboards as an alternative?

    Hth

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Point sprites not responsive to projection changes

    Originally posted by <quaice>:
    but is hindered by a relatively small maximum size (glGet* with GL_POINT_SIZE_MAX), not to mention viewport edge clipping issues. In short, it's not likely to behave the way you apparently want it to.
    Not true!

    The limits in GL_POINT_SIZE_RANGE or GL_SMOOTH_POINT_SIZE_RANGE for that matter are only used for the standard GL point rendering, not for point sprites.

    glGet with GL_POINT_SIZE_MAX merely returns the state you set via glPointParameterf(). It might be that the initial state has been set to the fixed function maximum point range.

    Just set the maximum you want via the function glPointParameterf(GL_POINT_SIZE_MAX, (float)yourSize) an try how big the point sprites (glEnable(GL_POINT_SPRITE)!) can be rendered on your implementation.
    Different hardware might impose different limits though.

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2005
    Location
    boulder, co
    Posts
    228

    Re: Point sprites not responsive to projection changes

    Well, in practice it seems to be the same though.At least on my GF6600, the max size is 64 pixels for point sprites, and I can't crank it up any higher, no matter what I set GL_POINT_SIZE_MAX to...

  5. #5
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Point sprites not responsive to projection changes

    Using the point parameter attenuation formula or glPointSize? glPointSize will not work for this.

  6. #6
    Guest

    Re: Point sprites not responsive to projection changes

    I think the point is that on some hardware (NVIDIA's, for example) the max size attainable for a point sprite is 64 or thereabouts, hence the points-sprite is not a generic drop-in replacement for billboards, which of course can be of arbitrary size on any hardware and don't suffer from the point clipping strategy.

    I'm not even sure that's what the original poster had in mind. In fact, I'm not quite sure what the original poster is asking, to be perfectly honest

  7. #7
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Point sprites not responsive to projection changes

    Originally posted by <slim>:
    I think the point is that on some hardware (NVIDIA's, for example) the max size attainable for a point sprite is 64 or thereabouts,
    And my point is to prove that this is not the case.

    Just add this code to an application which renders points and you'll see that point sprites go well beyond the standard point size range on NVIDIA hardware. Do not issue glPointSize() in that case.

    I'm not even sure that's what the original poster had in mind. In fact, I'm not quite sure what the original poster is asking, to be perfectly honest
    The original question is how to get the screen space point size to become viewport size dependent and the answer is to either use point sprites and set the GL_POINT_SIZE_MIN and _MAX values depending on your viewport size, or to overcome the ugly clipping behaviour with billboard quads.

Similar Threads

  1. Point Sprites & AMD
    By Nowhere-01 in forum OpenGL: Drivers
    Replies: 6
    Last Post: 05-31-2011, 09:47 AM
  2. Fix point sprites
    By Alfonse Reinheart in forum OpenGL: General
    Replies: 3
    Last Post: 01-25-2011, 09:14 AM
  3. Point sprites
    By red_gfx in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-04-2009, 11:57 AM
  4. Point sprites
    By devdept in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-19-2008, 02:04 PM
  5. Point Sprites
    By Zeno in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-03-2001, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean