tags:

views:

1333

answers:

3
A: 

Not possible with a fixed opengl function. Dots are always square :)

You have to draw your own circle (by building it up like a cake, piece by piece) or draw a GL_QUAD with a "circle" texture on.

best regards, andre

Bigbohne
so what GL_POINT_SMOOTH is good for then?
Tamás Szelei
According to the opengl reference: "If antialiasing is enabled, then point rasterization produces a fragment for each pixel square that intersects the region lying within the circle having diameter equal to the current point size and centered at the point's x w y w . The coverage value for each fragment is the window coordinate area of the intersection of the **circular region with the corresponding pixel square.**"
Tamás Szelei
Actually, it is possible, but it's up to the OpenGL driver how well (or even whether) it'll work. In my testing, it gives round points with nVidia hardware/driver, but with ATI/AMD hardware/driver, it gives square points.
Jerry Coffin
+7  A: 
Mads Elvheim
And what about the reference I cited at the other comment? If I don't misunderstand it, it suggests that GL_POINT_SMOOTH does make circular points. Or do I?
Tamás Szelei
Yes, I read about that and tried it out. Funny, I didn't know :-)
Mads Elvheim
Thank you for the very detailed answer.
Tamás Szelei
You're very much welcome. Feel free to meet more of us on ##opengl and ##opengl3 on the FreeNode IRC-network.
Mads Elvheim
A: 

Mads' answer provides everything you need if you go for the fixed function pipeline. However, if you have a system that does not provide the ARB_point_sprite extension or with a broken implementation (some ATI drivers), you can solve this part also with geometry shaders. The ARB_geometry_shader4 extension allows you to convert a point primitive to two triangles, which can be used as the quad created by the ARB_point_sprite extension. On OpenGL 3.2, geometry shaders are already supported in core, no extension needed. The OpenGL wiki has two examples.

Malte Clasen