About gl_Vertex to compute position

I try to practice GLSL in gl_Vertex

this is my test program
in http://stmail.fju.edu.tw/~a8851034/glutglsl3_test.rar link

I use gl_Vertex to comuter the fragment color.
If the gl_Vertex 's y value is <0
to use one color, else another.

But I see the result the color is not clear seperate…but smooth…

WHY? I don’t understand…

thanks

values get interpolated when they go from vertex->fragment
try doing the test in the fragment stage instead

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.