     gNormal = vNormal[index];
 #else
     gNormal = normal;
+#endif
+#ifdef VARYING_COLOR
+    gColor = vColor[index];
 #endif
     gl_Position = ProjectionMatrix * vPosition[index];
     EmitVertex();

#ifdef VERTEX_SHADER

layout (location=0) in vec4 position;
layout (location=1) in vec3 normal;

out vec4 vPosition;
out vec3 vNormal;

void main()
{
    vPosition = ModelViewMatrix * position;
    vNormal = (ModelViewMatrix * vec4(normal, 0.0)).xyz;
}

#endif

in vec4 gPosition;
in vec3 gNormal;
noperspective in vec4 gEdgeDistance;
#ifdef VARYING_COLOR
    in vec3 gColor;
#endif

out vec4 outColor;

