Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: NV_POINT_SPRITE

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    NV_POINT_SPRITE

    Hi guys, I want to try out the new point sprite extension but after having read the spec a few times I'm not sure how to implement it. There doesn't seem to be a tutorial/demo for it yet. Does anyone know how to use it? Presumably I need to bind a texture, enable NV_POINT_SPRITE then render the points? enabling Texture_2D and drawing with points is slow and draws nothing. Looking at the spec I think I need to use COORD_REPLACE_NV somewhere but I'm not sure where/why.

    Will the point sprite size vary with Z or will it behave like GL_POINTS?

    Thanks

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: NV_POINT_SPRITE

    You need to call, for each texture unit that you want point sprite texture coordinate generation:

    glTexEnvi(GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV, GL_TRUE);

    You can set this on any or all texture units.

    On the other hand, the point sprite R coordinate mode (zero, S, or R) is global across all texture units.

    - Matt

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    Re: NV_POINT_SPRITE

    Ok thanks but I was looking for more along the lines of (and this doesnt work but its the way I'm currently doing it)


    #ifndef GL_NV_point_sprite
    #define POINT_SPRITE_NV 0x8861
    #define COORD_REPLACE_NV 0x8862
    #define POINT_SPRITE_R_MODE_NV 0x8863
    #endif

    glEnable(GL_TEXTURE_2D);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
    glGenTextures(1,&Texture);
    glBindTexture(GL_TEXTURE_2D, Texture);

    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL _CLAMP);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL _CLAMP);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);

    glTexEnvf(POINT_SPRITE_NV,COORD_REPLACE_NV,GL_TRUE );


    Load Texture....

    Main Loop

    glEnable(POINT_SPRITE_NV);
    glEnable(GL_TEXTURE_2D); (should this be enabled?)
    glBindTexture(GL_TEXTURE_2D, Texture); (I must need this surely)
    glBegin(GL_POINTS);

    Loop through points and render using a single glVertex and glColor. I dont need glTexCoord2f do I?

    glEnd();

    With GL_TEXTURE_2D enabled its very slow and draws nothing, with it disabled I just get the standard points.

    I have an original Geforce 3 and detonatots 27.7, it should work on this hardware/driver config right?

  4. #4
    Intern Contributor
    Join Date
    Feb 2002
    Posts
    58

    Re: NV_POINT_SPRITE

    Originally posted by Adrian:
    I have an original Geforce 3 and detonatots 27.7, it should work on this hardware/driver config right?
    Not according to the compatibility matrix at the beginning of the document, it won't. It's listed as NV25 only.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    Re: NV_POINT_SPRITE

    Damn, you're right, I only checked the txt document. I kind of assumed since I can see point sprites in the 3D mark I would get it with OpenGL to. Thanks for pointing that out.

  6. #6
    Intern Contributor
    Join Date
    Feb 2002
    Posts
    73

    Re: NV_POINT_SPRITE

    doesn't the compatibility matrix in nvopenglspecs.pdf refer only to the driver version? E.g., GL_EXT_multi_draw_arrays is listed for R25 on NV1x, and I have it in my extension string (GF2). Just check your extensions string to be sure...

    Michael

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    Re: NV_POINT_SPRITE

    I've checked my extension string it's not there. Interestingly NV_POINT_SPRITE is the only extension only available on the Geforce 4. I would have thought it could be emulated on older hardware...

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: NV_POINT_SPRITE

    point_sprites and texture_shaders3 i guess..

    too bad, i waited for point_sprites in gl now over one year for my gf2mx..
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  9. #9
    Advanced Member Frequent Contributor
    Join Date
    May 2000
    Location
    London, UK
    Posts
    548

    Re: NV_POINT_SPRITE

    According to the pdf, texture shader3 is emulated on nv1x but you'll need the latest drivers(R25) for it.

  10. #10
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: NV_POINT_SPRITE

    NVidia has GL_NV_point_sprite, ATi has GL_ATIX_point_sprite. What about making an EXT?

    Just a thought ...

Posting Permissions

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