Correspondance between texture units and sampler uniforms in opengl
问题 The correspondence between sampler uniforms and texture units used by glActiveTexture apparently can't be queried with opengl, and I can't find good documentation on how to find which texture unit is mapped to which sampler uniform. Here is what I have been able to find: If there is only sampler uniform in a program, then it is mapped to gl_TEXTURE0 If there are multiple sampler uniforms in a single program stage, then they are mapped in the order they are declared in the shader. If the