varying vec3 vertex; // Vertex position in world

void main( void )

{

vec3 vvertex = normalize(vertex) + 1.0;

float x = vvertex.x;

if ( x < 1.0 )

x = 0.0;

else

x = 1.0;

gl_FragColor = vec4( x, 0.0, 0.0, 1.0 );

}

Both the code above and the one below draws a red pixel on the screen. What am I missing? (Hopefully you can tell I am frustrated about this)

varying vec3 vertex; // Vertex position in world

void main( void )

{

vec3 vvertex = normalize(vertex) + 1.0;

float x = vvertex.x;

if ( x >= 1.0 )

x = 0.0;

else

x = 1.0;

gl_FragColor = vec4( x, 0.0, 0.0, 1.0 );

}