34 lines
465 B
Plaintext
34 lines
465 B
Plaintext
@vs pointvs
|
|
|
|
in vec2 apos;
|
|
in vec4 acolor;
|
|
in float aradius;
|
|
|
|
uniform pvs_p { mat4 proj; };
|
|
|
|
out vec4 fcolor;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = proj * vec4(apos, 0.0, 1.0);
|
|
fcolor = acolor;
|
|
gl_PointSize = 1.0;
|
|
}
|
|
@end
|
|
|
|
@fs pointfs
|
|
out vec4 color;
|
|
|
|
in vec4 fcolor;
|
|
|
|
void main()
|
|
{
|
|
float d = length(gl_FragCoord.xy - vec2(0.5,0.5)); /* Should really pointcoord, normalized */
|
|
if (d >= 0.1)
|
|
discard;
|
|
|
|
color = fcolor;
|
|
}
|
|
@end
|
|
|
|
@program point pointvs pointfs |