开发者

Do GL_LINES create triangles or use their own processing?

开发者 https://www.devze.com 2023-04-10 03:34 出处:网络
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 en

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

精彩评论

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