gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

sektion31
Hi,

I couldn't find a bugtracker so I am posting this here on the forum.

I noticed that I have to enable GL_POINT_SPRITE via GL4bc profile to make gl_PointCoord work. In the default GL4 profile GL_POINT_SPRITE is disabled (which is the correct behavior), but one can not turn it on because GL_POINT_SPRITE is not existant anymore in GL4 (also correct).

So shouldn't gl_PointCoord just work by default in GL4 without enabling GL_POINT_SPRITE?
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

gouessej
Administrator
Hi

GL_POINT_SPRITE is in GL2ES1, nothing prevents you from enabling this feature. JOGL is mostly a Java binding for the OpenGL and OpenGL-ES APIs, I don't see why it should arbitrary enable a few features by default. In my humble opinion, this is not a bug. Best regards.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

JanBenes
I'm going to try and add to the discussion.

1) I initially mis-understood gouessej's comment as "switch to GL-ES" or do that part in GL-ES. What he probably actually means is you can use GL2ES1 "constants" as parameters in GL3/4 glEnable calls, e.g.
GL3 gl = drawable.getGL().getGL3();
gl.glEnable(GL2ES1.GL_POINT_SPRITE);
which solves the problem for me, although I am not sure how legal or illegal this is.

2) I do not have this problem under Mac OS. It only manifested itself once I tried the code on Windows. I assume that is a driver difference thing (?), not a problem in JOGL.
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

jmaasing
That sure sounds like a driver bug. Point sprites are (as you say) removed since GL 3.3. Hopefully that work-around does not produce errors on other drivers.
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

gouessej
Administrator
In reply to this post by JanBenes
Use GLBase.isExtensionAvailable() and GLBase.isFunctionAvailable() if you want to check whether an extension and a function are available.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

JanBenes
@gouessej I don't see how this is applicable here. Could you give a more specific example/code snippet? I can't think of or find a function or extension I could check.
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

jmaasing
In reply to this post by gouessej
gouessej wrote
Use GLBase.isExtensionAvailable() and GLBase.isFunctionAvailable() if you want to check whether an extension and a function are available.
I don't know if that helps in this case. If I understand the specification correctly GL_POINT_SPRITE has been removed in OpenGL 3.3, it is neither an extension nor a function that is supposed to exist in GL4. The reason was that it is not needed since PointCoord should be available in shaders for ordinary points, so no need for point sprites.

I would guess that If the shader works when enabling GL_POINT_SPRITES it is either * not a GL4-context (i.e. using GL2) or * the driver has a serious bug.
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

JanBenes
@jmaasing Good point. I have no idea how this could be circumvented. I will be able to try on a Mac in about a week. On Window, I'm using nVidia's drivers, v334.89 (GeForce 660 Ti), which I just updated to from 311.0.  Both exhibit the same behaviour.

I am a bit sceptical that a bug that changes the behaviour of a rather frequently used feature would still remain unfixed. Could there be a different problem? I've tried a DebugGL3 context and that didn't provide my with any more info (no warnings/errors reported).

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

jmaasing
JanBenes wrote
@jmaasing Good point. I have no idea how this could be circumvented. I will be able to try on a Mac in about a week. On Window, I'm using nVidia's drivers, v334.89 (GeForce 660 Ti), which I just updated to from 311.0.  Both exhibit the same behaviour.

I am a bit sceptical that a bug that changes the behaviour of a rather frequently used feature would still remain unfixed. Could there be a different problem? I've tried a DebugGL3 context and that didn't provide my with any more info (no warnings/errors reported).

Thanks!
Yes I agree, an nVidia driver bug for gl_PointCoord sounds far fetched. I'm out of ideas
Reply | Threaded
Open this post in threaded view
|

Re: gl_PointCoord not working without enabled GL_POINT_SPRITE - is it a bug?

elect
I had the same problem while porting a sample from C to Jogl and after two days stuck luckily I found this thread (together with one on opengl.org)..

It was enabled on C while it wasn't on Jogl and a simple gl3.glEnable(GL_POINT_SPRITE); helped