I added a vertex shader to this example:
void main()
{
gl_Position = ftransform();
}
then I get this image:
What am I doing wrong here?
I added a vertex shader to this example:
void main()
{
gl_Position = ftransform();
}
then I get this image:
What am I doing wrong here?
For texture mapping using a vertex shader you will also need to pass the texture coordinates as well as the vertex positions to the fragment shader. Examples, including the one below, can be found here
void main()
{
// Transforming The Vertex
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// Passing The Texture Coordinate Of Texture Unit 0 To The Fragment Shader
texture_coordinate = vec2(gl_MultiTexCoord0);
}