title: OpenGL texture base internal format to a shader
body: <p>I am trying to mimic the behavior of OpenGL glTexEnv with a shader. It is quite complex function but should be doable. The only problem is that the function works differently depending on the texture base internal format. How can I get that information out of a texture? The texture base internal format is given with glTexImage2D function so do I have to save it there to some variable and pass it to the shader with some uniform depending on bound texture, or can I get it somehow with OpenGL?</p>