I want to render filled circles of a dynamically varying radius around a set of points whose 2D coordinates are stored in a VBO. So far I was using GL_POINT_SMOOTH, but having now shifted to OpenGL 4.0, this option is no longer available. I have seen a similar question here but that doesn't quite suit my need because the centres of the circles in that example are hard-coded in the fragment shader. How would I do this?
At the moment, my vertex shader looks like this:
#version 400
layout(location=0) in vec2 in_Position;
layout(location=1) in vec4 in_Color;
out vec4 ex_Color;
uniform vec4 bounds;
void main(void){
float x = -1+2/(bounds.y-bounds.x)*(in_Position.x-bounds.x);
float y = -1+2/(bounds.w-bounds.z)*(in_Position.y-bounds.z);
gl_Position = vec4(x,y,0,1);
ex_Color = in_Color;
}
And my fragment shader looks like this:
#version 400
in vec4 ex_Color;
out vec4 out_Color;
void main(void){
out_Color = ex_Color;
}
With these shaders, I am getting square points.