Has anyone successfully used uniform arrays in a shader? I can't seem to get them working. If I set the value in the shader itself it works fine, but I can't seem to set it in AGK.
Pixel Shader
// GET VERTEX DATA
varying vec3 positionVarying;
varying vec3 normalVarying;
varying vec2 uvVarying;
// GET PIXEL COLOR
uniform vec4 PColor[1];
// SHADER
void main()
{
gl_FragColor = PColor[0];
}
SetShaderConstantByName(Shader, "PColor[0]", 0, 1, 0, 0)
I'm also wondering how I should handle multiple cameras with shaders. I'm using a uniform CameraPosition variable that I pass to through AppGameKit, but I'm not sure how I would set up the draw code so that it sets the position for the first camera, draws that, then does the same for the second. Is there any way to get the camera position in the shader without explicitly sending it through code?