Archived

This topic is now archived and is closed to further replies.

mictian

why is GL_LINES slower than GL_FILL

Recommended Posts

when i have a textured surface, why is rendering faster when i use GL_FILL for polygon mode? i figured it is because when i use GL_LINES i can see through the polys to polys behind them, and hence more polys are rendered total, but i want to know the correct reason.

Share this post


Link to post
Share on other sites
I think (may be wrong) that the reson behind this is that hardware is geared/optimised towards dealing with textured polygons and not lines.

And your point is right of course. Lines = no exclusion = a lot more stuff to render.

Share this post


Link to post
Share on other sites
I dont know how it is now, but older cards didnt support linedrawing, so the lines are implemented as non projectional quads, that is 2 triangles per line.

Share this post


Link to post
Share on other sites
I know with nVidia cards, line drawing is done in software (unless you buy one of their Quadro cards, or convert your card over to a Quadro). There may be some driver utility that allows you to turn hardware line drawing on, so check it out sometime .

Share this post


Link to post
Share on other sites
Does OpenGL actually implement some sort of occlusion culling?!? I thought that it rendered every polygon on screen, some just on top of others... unless, of course, you tell it not to.

Share this post


Link to post
Share on other sites
all it will do is a z-test for every pixel before drawing. as most of the work is done before that its no alternative to cull yourself (just like clipping isnt an excuse for not doing any frustum culling).
there are occlusion query extensions, but they require you to first render part of your scene and then "test render" other parts (or simple bounding volumes). doing this test takes quite some time, though there are a few examples of how to get the most out of it (still far from being an alternative to do it yourself).

btw. using line_strips might not give the exact same result, but for a simple wireframe its fine and for some reason a lot faster than changing the polygon mode (especially if you disable textures.. i get 3 times more fps than rendering the textured faces).

Share this post


Link to post
Share on other sites