mwlow
mwlow

Reputation: 141

Vertex Shader trouble

I'm having trouble getting my vertex shader (1.20) to work. I'm rendering a simple white triangle, but when I load the vertex shader the triangle disappears.

void main()
{
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

I've also tried:

void main()
{
    gl_Position = ftransform();
}

to no avail. I'm really confused because my fragment shader does work. For example,

void main()
{
    gl_FragColor = vec4(.5, .6, .3, 1);
}

will turn my triangle green. I can't spot anything wrong (and the shaders compile without errors), so I'm wondering if anyone has any ideas.

Upvotes: 0

Views: 257

Answers (1)

Ben Jackson
Ben Jackson

Reputation: 93690

I think you need to copy color and texture information as well:

            gl_FrontColor = gl_Color;
            gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;

(and much more if you intend to emulate all of the behavior of the fixed function pipeline)

Upvotes: 3

Related Questions