In setting up the fragment shaders for my OpenGL game I've found that when an object darkens from being far from lights, it also loses opacity as the gl_FragColor calculation affects all four members of the color points:
GLES20.glEnable(GL_BLEND);
GLES20.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
final String Light1fragmentShader =
...
"varying vec4 v_Color;" +
...
"void main()" +"{" +
...
"gl_FragColor = v_Color * diffuse * texture2D(u_Texture, v_TexCoordinate);" +
...
Since my game has tranparency enabled through GL_BLEND, my opaque textured objects render as transparent when the light is low or the sightline to normal is high as the alpha is also reduced with the RGB values. Is there an elegant way to set up my fragment shader to only have the first 3 members of each vec4 color point be affected by the diffuse?