Hybrid View

Varying type doesnot interpolate

I am new to shader programming. I am trying to draw a circle with glsl. My os is Ubuntu 12.04.I used a point with a Size and tried to filter out the points outside the radius.(Altering the alpha value).
The code is as follows:

This results in drawing a square if I replace d with 1.0 in the following line(in fragment shader):
gl_FragColor = vec4(0.0, 1.0, 0.0, d); -> if d is replace by 1.0

I tried to replace the x and y values in gl_FragColor with textureCoordinate.x and textureCoordinate.y. Result was black(so I assume the values are 0.0). Thing which I dont understand is that if I take the length of textureCoordinate than it is always 1.0.(experimented by replacing the value in gl_fragcolor). I am unable to figure out as to what I am doing wrong here. I was expecting the textureCoordinate value to interpolate w.r.t the passed in data(varPos).
Thanks for any pointers.

you are drawing one point which is one vertex, so there is only one attribute value and nothing to be interpolated. Maybe you want to draw a quad or trianglestip consisting of 4 vertices? then the varying from these 4 vertices will get interpolated.