I've got a frag file with these two variables:
uniform highp sampler2D textureImage1;
uniform highp sampler2D textureImage2;
And in my code I'm binding images to these with:
[myNode.geometry.firstMaterial handleBindingOfSymbol:@"textureImage1" usingBlock:^(unsigned int programID, unsigned int location, SCNNode *renderedNode, SCNRenderer *renderer) {
glBindTexture(GL_TEXTURE_2D, texture1.name);
}];
[myNode.geometry.firstMaterial handleBindingOfSymbol:@"textureImage2" usingBlock:^(unsigned int programID, unsigned int location, SCNNode *renderedNode, SCNRenderer *renderer) {
glBindTexture(GL_TEXTURE_2D, texture2.name);
}];
What's weird is that the first image appears for both textures.
Can I only use one texture per frag file?
This is iOS 8.
It works if I do this: