Can I find the internal texture format in the shader?

Is it possible to find the internal texture format in the shader (glsl)?

For example, if I have a texture with a format GL_RG, is it possible to recognize in the shader that the blue and alpha values ​​are "constant" and can be ignored?

I know that I can use a form to pass a texture type from C ++ to shaders. But is there an “internal” way to learn from a shader?

+4
source share
1 answer

No, I do not believe that there is anything that will give you this information directly.

GLSL (4.50 ), , "8.9.1. ", 158. :

  • textureSize: .
  • textureQueryLod: , .
  • textureQueryLevels: mipmap .
  • textureSamples: .

, - , , , , .

+3

Source: https://habr.com/ru/post/1617745/


All Articles