1

I noticed I could not change the size of points in the vertex shader with gl_PointSize in my OpenGL ES 3.0 android application. Eventually I found out that I had to enable GL_PROGRAM_POINT_SIZE even though this enum value isn't defined in the gl header file. So I ended up adding glEnable(0x8642);

Everything works fine now, but is this a bug? Or is there a reason that I need to enable this. I know I need to do this on a compatibility context in Windows, but I thought on Android I would be working with a pure ES 3.0 context. Maybe my GL context wasn't set up correctly?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Martin
  • 93
  • 1
  • 6

1 Answers1

1

That looks like a bug. The mode that is enabled with GL_PROGRAM_POINT_SIZE in full OpenGL (and that is disabled by default) is always active in OpenGL ES, and cannot be turned off.

I believe some of the newer Shield devices also support full OpenGL. I suspect that they underlying driver is shared, and the setting for this state is not adjusted when it's running the ES API.

Reto Koradi
  • 53,228
  • 8
  • 93
  • 133
  • Thanks for your comment! So yesterday I was able to test my application on another device (HTC M8) and I was getting an error that implied that I did not have a GLES 3 context. So I checked my code and compared it with some example code, and it turns out I was creating my context without providing the attribute list to specify that I wanted an ES 3 context. So I thought the shield just defaults to an ES 3 context, but after reading your comment, it makes sense that the Shield has a full OpenGL implementation and it defaults to that. Thanks for the help! – Martin Sep 23 '15 at 14:07
  • And by the way, I tested it again with the glEnable(GL_PROGRAM_POINT_SIZE) removed, and now the particles are the correct size. – Martin Sep 23 '15 at 14:11