Why, when I manually change the alpha value in the array, is passed to the shader, the result is the same for both 0.0fand 1.0f?
I expected the object to be drawn with some level of transparency, depending on the alpha value.
I do not use any textures. I always see my red object on a black background.
access to the variable glslfrom java..
float[] color = {1.0f, 0.0f, 0.0f, 1.0f};
gl2.glGetUniformLocation(shaderProgram, "vColor");
gl2.glUniform4fv(mColorHandle, 1, color, 0);
glsl, fragmented shader ..
#version 120
uniform vec4 vColor;
void main() {
gl_FragColor = vColor;
gl_FragColor.a = 0.0;
}
source
share