pouët.net

Go to bottom

Triangle fill on modern gpus?

category: general [glöplog]
 
I'm wondering how internally modern gpus coordinate what pixels get processed by the pixel processors. My assumption for so far has been maybe each pixel processor gets a square of pixels and is fed the triangle geometry. It then clips this geometry by its square and then processes those pixels. Is this correct? How do you think this works? I assume it doesn't feed the pixels processors individual pixel coordinates as that would be a bottleneck. Any thoughts?
added on the 2010-02-17 12:27:08 by sigflup sigflup
http://www.cs.unc.edu/~olano/papers/2dh-tri/ (I recommend the PDF version)
http://software.intel.com/en-us/articles/rasterization-on-larrabee/ (some finer points in there)

No matter how exactly it's done, there's no explicit clipping involved anywhere (except possibly the view frustum clip at the very beginning; you need to keep the coordinates within certain limits to avoid overflows). The output of the rasterizer unit is a stream of quads (2x2 pixels) with coverage masks. Pixel shading is always done on quads, on all current architectures. Even when only one pixel in the quad is actually visible, the whole quad is shaded (part of the reason why small or very narrow triangles are inefficient).
added on the 2010-02-17 12:41:57 by ryg ryg
What ryg said. Basically, the geometry is fed to a triangle-setup unit, that calculates an "ax + by + c" function per triangle edge and/or barycentric weights. Then these functions are evaluated per fragment. I believe most modern rasterizers work in an hierarchical fashion, to quickly be able to discard empty areas.

Shameless plug
added on the 2010-02-17 17:51:00 by kusma kusma
wtf, you filed a US software patent? why?
added on the 2010-02-17 19:26:08 by skrebbel skrebbel
Thank you guys, that was really informative!
added on the 2010-02-17 21:34:29 by sigflup sigflup
skrebbel: it's not a software patent.
added on the 2010-02-17 21:42:52 by kusma kusma

login

Go to top