It would help if he defined what "subpixel accurate" means. I can't figure out why you'd care about subpixels if you're producing a bitmap image? Or is he doing something like cleartype but not antialiased?
How to draw ugly lines fast
11–20 of 47 posts
Re: How to draw ugly lines fast
#12It would help if he defined what "subpixel accurate" means. I can't figure out why you'd care about subpixels if you're producing a bitmap image? Or is he doing something like cleartype but not antialiased?
Re: How to draw ugly lines fast
#13It would help if he defined what "subpixel accurate" means. I can't figure out why you'd care about subpixels if you're producing a bitmap image? Or is he doing something like cleartype but not antialiased?
With subpixel precision (e.g. you do all the math at a higher precision than the framebuffer resolution, and preserve the fractional part of pixel coordinates in all computations until you actually write to the framebuffer), the outlines remain stable even for small movements. IIRC Quake (with the software renderer) was one of the first games which paid proper attention to subpixel accuracy, and they showed this off with a very slight camera movement at the result screen after a multiplayer match. Triangle edges were properly 'crawling' instead of being all jittery.
Re: How to draw ugly lines fast
#14Is it possible to do a SIMD version? I know compute shaders exist, but I have found that with huge datasets and a wide variety of end-user hardware, it tends to end up with many lines of code and brittleness. So I’m curious about high performance CPU-only implementations.
Re: How to draw ugly lines fast
#15It would help if he defined what "subpixel accurate" means. I can't figure out why you'd care about subpixels if you're producing a bitmap image? Or is he doing something like cleartype but not antialiased?
Re: How to draw ugly lines fast
#16Re: How to draw ugly lines fast
#17Re: How to draw ugly lines fast
#18What's wrong with drawing (possibly resulting in thicker line) pixels everywhere the mathematical line intersects the pixel?
Re: How to draw ugly lines fast
#19It would help if he defined what "subpixel accurate" means. I can't figure out why you'd care about subpixels if you're producing a bitmap image? Or is he doing something like cleartype but not antialiased?
It becomes important with low resolution framebuffers and once things start to move. Triangle outlines in early 3D games tended to wobble and jitter because the 'math' didn't work at subpixel precision (many PS1 3d games suffered from this). With subpixel precision (e.g. you do all the math at a higher precision than the framebuffer resolution, and preserve the fractional part of pixel coordinates in all computations…
Re: How to draw ugly lines fast
#20This was wonderful to read. Informative, well explained, and humorous (the reference to "a pixel is not a little square" took me by surprise and made me laugh). I feel like I've gotten a better understanding of things I thought I knew already. The only question left in my mind is "why does he always need to write new subpixel-accurate line drawers?!"
Tom Forsyth
GPU designer and gfx coder
Gfx coder and chip designer. Worked at Oculus, Valve, RAD, Muckyfoot, 3Dlabs, now back at Intel. Blade2, Larrabee, TF2, VR and many other atrocities.