I am trying to dynamically fade items as they appear further away.
I have this which works fine and textures display fine but does not fade.
effect.texture2d0.enabled = GL_TRUE;
effect.texture2d0.envMode = GLKTextureEnvModeReplace;
effect.texture2d0.target = GLKTextureTarget2D;
effect.texture2d0.name = texture.name;
// transparancy
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I then change it to this (based on a few stack overflow posts). enabling GLKTextureEnvModeModulate or adding glColor4f gives me a error of GL ERROR: 0x0502
effect.texture2d0.enabled = GL_TRUE;
effect.texture2d0.envMode = GLKTextureEnvModeModulate;
effect.texture2d0.target = GLKTextureTarget2D;
effect.texture2d0.name = texture.name;
// transparancy
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // GL_SRC_ALPHA
glColor4f(0.7, 0.7, 0.7, 0.7);