I have a fragment shader:
[NOTE] varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform lowp vec4 mask[360000];
uniform lowp vec4 frame[360000];
void main()
{
float frameAlpha = frame[10].a;
if (frameAlpha != 0) {
gl_FragColor = vec4(mask[10].r, mask[10].g, mask[10].b, frameAlpha);
}
else {
lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
gl_FragColor = vec4(textureColor.rgb, textureColor.w);
};
}[/NOTE]
I want to set the arrays from outside the shader. I try to do this:
[NOTE]int maskArrayLocation = GLES20.glGetUniformLocation(getProgram(), “mask”);
int frameArrayLocation = GLES20.glGetUniformLocation(getProgram(), “frame”);[/NOTE]
But both functions return me -1. Where is the problem?