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 8 of 8

Thread: gl_PointCoord problem

  1. #1
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46

    gl_PointCoord problem

    gl_PointCoord is not working(always returns 0). If I use GL_POINT_SPRITE, it works, however that was removed in GL 3.2, ...and Im using 3.3 now.
    So it works, but I have to use something that was removed in the GL version Im developing with. Is this my drivers bug, or do I misunderstand something? Can I expect consistent behavior on other GPUs and drivers with this "hack"?
    (My GPU is GeForce 8800 GT)

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    14
    Hi
    I had the same issue with 4.3 (on Nvidia 630M), but I am using openGL trough JOGL. So I asked there if it was a bug, but they said its all fine.
    So I think this behavoir is normal and will stay the same for future versions. On the other hand: Don't trust me, because I am a total noob, just started learing openGL.

  3. #3
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46
    Quote Originally Posted by sektion31 View Post
    Hi
    I had the same issue with 4.3 (on Nvidia 630M), but I am using openGL trough JOGL. So I asked there if it was a bug, but they said its all fine.
    So I think this behavoir is normal and will stay the same for future versions. On the other hand: Don't trust me, because I am a total noob, just started learing openGL.
    OK Thanks anyway!

  4. #4
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    302
    If you're using the Compatibility profile, GL_POINT_SPRITE still exists and must be explicitly enabled. GL_POINT_SPRITE is only removed in the Core profile, and gl_PointCoord should always be producing proper coordinates in Core.

  5. #5
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,067
    Quote Originally Posted by Aliii View Post
    gl_PointCoord is not working(always returns 0). If I use GL_POINT_SPRITE, it works, however that was removed in GL 3.2, ...and Im using 3.3 now.
    What is removed? Point sprites? Certainly not! Just glEnable(GL_POINT_SPRITE) is removed since it is always on in post GL 3.2 versions.

    Quote Originally Posted by GLSpec
    Non-sprite points - Enable/Disable targets POINT_SMOOTH and POINT_SPRITE, and all associated state. Point rasterization is always performed as though POINT_SPRITE were enabled.
    If you tried to surf the Web you could find Graham Sellers's post on it.

    Quote Originally Posted by GLSLang_spec
    The values in gl_PointCoord are two-dimensional coordinates indicating where within a point primitive the current fragment is located, when point sprites are enabled. They range from 0.0 to 1.0 across the point. If the current primitive is not a point, or if point sprites are not enabled, then the values read from gl_PointCoord are undefined.

  6. #6
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46
    Thanks!
    "What is removed? Point sprites? Certainly not! Just glEnable(GL_POINT_SPRITE) is removed since it is always on in post GL 3.2 versions."

    I understand that in 3.2+ core it should be enabled by default. But its not. I have to hack it by using the "removed" glEnable(GL_POINT_SPRITE).

    Well, I dont know if theres a way to explicitly select the Core profile, ....what Im I doing now is using the gl_3_3 core header.

  7. #7
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,067
    Quote Originally Posted by Aliii View Post
    Well, I dont know if theres a way to explicitly select the Core profile, ....what Im I doing now is using the gl_3_3 core header.
    Header file is just a header file. Contains signatures of the functions and constants. Nothing more.
    By default a Compatibility profile is created. If you want the Core profile it must be specified in context creation process with wglCreateContextAttribsARB/glxCreateContextAttribsARB function.

  8. #8
    Intern Newbie
    Join Date
    Oct 2011
    Posts
    46
    Thanks! It works now as expected. Now it also gives an INVALID_ENUM error if I try to use the GL_POINT_SPRITE.

Posting Permissions

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