开发者

Do GL_LINES create triangles or use their own processing?

I've been curious about GL_LINES (and GL_LINE_LOOP and STRIP) for some time, and i'm wondering how the GL imp开发者_运维技巧lementations typically handle them. Do they extrapolate a quad from the endpoints and width of the line? Does it do something more primitive and specialized?

I know it's implementation specific, but given a generic nVidia or ATI driver and windows hardware, what could i expect GL to be doing to generate those fine upstanding lines?


Usually lines are rasterized directly using some variant of Bresenham's algorithm, which is much faster (and easier to implement) than a scanline, primitive filling rasterizer. Modifications of Bresenham's allow for thick, antialiased lines.

Technically the challenge lies in determining which fragments in the buffer are covered by a primitive. This happens by fixed wired hardware, after the tesselation, geometry and vertex shaders, but before the fragment shader.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜