2

I am now working on android system using opengl es 2.0. I know that in order to get the number of the maximum number of textures available in a fragment shader, I can try to get the value of GL_MAX_TEXTURE_IMAGE_UNITS. However, I found that the value of this constant is 34930. But I read from a book that only 8 textures can be used in a fragment shader. I am wondering what does the value of 34930 mean?

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
Timothy
  • 469
  • 1
  • 5
  • 19

1 Answers1

7

That value is just the integer value of the OpenGL enum GL_MAX_TEXTURE_IMAGE_UNITS. It's not the number of texture units available.

To get the number of available texture units, you have to use

int[] max = new int[1];
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, max, 0);
Tim
  • 35,413
  • 11
  • 95
  • 121