Hi,
I want to use the new multi texturing features.
glBindTextures(0, textureIDs.size(), textureIDs.data());
It works !
However, I also want to bind the uniforms in a concise manner.
Like this.
uniform sampler2D textures[] ;
Works as well.
But how do I go about bining the uniforms.
The only thing that works is this:
glUniform1i(glGetUniformLocation(shader, “textures[0]”), 0);
glUniform1i(glGetUniformLocation(shader, “textures[1]”), 1);
glUniform1i(glGetUniformLocation(shader, “textures[2]”), 2);
glUniform1i(glGetUniformLocation(shader, “textures[3]”), 3);
Which I find insultingly crude.
The following works for two textures
glUniform1i(glGetUniformLocation(shader, “textures”), 0);
glUniform1i(glGetUniformLocation(shader, “textures”), 1);
glUniform1i(glGetUniformLocation(shader, “textures”), 2);
glUniform1i(glGetUniformLocation(shader, “textures”), 3);
So the question is, is there a nice way, without magic numbers and without bindless to bind textures to a combined sampler array.
Is there a Vulkan like solution im not aware of?