I have an application that involves some lines, and I would like to draw realistic 3d line widths. Trouble is, OpenGL only seems to support drawing lines a minumum of 1 pixel wide. Any smaller, and they stay at 1 pixel. If I set my hardware to oversampling, I can get smaller, but there’s still a minimum limitation, and I would prefer not to have to oversample every rendering.
Is there an easy way to draw OpenGL lines smaller than one pixel? Or should I just change my code to draw them as cylinders (with no lighting because I want flat coloured lines) so that they will have their correct display, with a slight performance overhead for rendering the cylinders.
Thanks for the reply. Yes, these were the 2 workaround solutions I was considering. I’ll probably have to try both and see which gives the best results. With solution 1, I don’t think I’ll bother with z-sorting. It’s a fully rotating model, and I’ve never worked out an easy logical way to do the z-sorting in an efficient way for fast refresh.
Anyway, thanks for confirming my thoughts.
A caveat about opting #2:
remember that clipping must be done in clip coordinate system, before the perspective divide (i.e. before getting to normalized screen coordinate system). Therefore, you must either do your computation in CCS, or clip against the near frustum yourself before doing your computation in NSCS.
Consider the case where a line segment’s endpoint is exactly at the camera’s origin.
This is a good reference:
http://www.cs.queensu.ca/~jstewart/454/notes/pipeline/