Im new to shaders and I'm trying to learn the basics. But everytime I change some code in my vertex shader it results in an error.
"Validation Failed: Program is not successfully linked."
Im using the standard openGL project for the iphone as a starter in Xcode ( with a 2d cube moving in y-position).
From the beginning the shader looks like this:
attribute vec4 position;
attribute vec4 color;
varying vec4 colorVarying;
void main()
{
gl_Position = position;
gl_Position.y += sin(translate) / 2.0;
colorVarying = color;
}
and I want to change it to :
uniform mat4 gl_ProjectionMatrix;
uniform mat4 gl_ModelViewMatrix;
attribute vec4 gl_Vertex;
void main()
{
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}
I all get is a white screen and the error mentioned above.
What's the problem?
/Niclas