PDA

View Full Version : gl_PointCoord problem



Aliii
11-26-2013, 01:30 PM
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)

sektion31
11-27-2013, 09:22 AM
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. ;)

Aliii
11-27-2013, 10:35 AM
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!

malexander
11-27-2013, 12:29 PM
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.

Aleksandar
11-27-2013, 12:30 PM
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.


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.


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.

Aliii
11-27-2013, 08:14 PM
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.

Aleksandar
11-28-2013, 06:06 AM
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.

Aliii
11-28-2013, 02:39 PM
Thanks! It works now as expected. Now it also gives an INVALID_ENUM error if I try to use the GL_POINT_SPRITE.