Followers 0

glPolygonMode slows down[solved]

23 posts in this topic

I have never looked into this, but just figured it was they way things are. When I render with GL_LINE my FPS drop to 1fps. Now when I was playing around with DX this never happened when rendering with lines vs. fill. What would cause such a drop? thanks [Edited by - MARS_999 on September 13, 2006 3:14:50 PM]
0

Share on other sites
When filled polyons are rendered, the graphics can use "Hierarchical Depth Buffer" and other Features to increase render speed. But when drawing lines, those components do not work.

But 1fps seems very low. When enabling this wireframe mode, I usually get 60-70% of the speed I had before on my X1800XT (don't know on Nvidia cards though).
0

Share on other sites
Quote:
 Original post by EnricoWhen filled polyons are rendered, the graphics can use "Hierarchical Depth Buffer" and other Features to increase render speed. But when drawing lines, those components do not work.But 1fps seems very low. When enabling this wireframe mode, I usually get 60-70% of the speed I had before on my X1800XT (don't know on Nvidia cards though).

Correct, but DX does this and I probably seen what you see and this is on a 7800GT... Only differece is GL vs. DX.
0

Share on other sites
I think you mean to be using GL_LINES not GL_LINE. Unless you mistyped it here, that could be your issue. Try changing it and see if that solves the problem :)
0

Share on other sites
I have observed that in general, wireframe mode is implemented by creating pixel wide triangles along the edges of the actual triangles being rendered. If you're clever you can expose this tactic through some carefully constructed geometry. In any case, it shouldn't be surprising that doing this is much slower.
0

Share on other sites
Quote:
 What would cause such a drop?

Do you have any unusual states enabled, such a smooth lines or wide lines?

Quote:
 Original post by Morpheus011I think you mean to be using GL_LINES not GL_LINE. Unless you mistyped it here, that could be your issue. Try changing it and see if that solves the problem :)

GL_LINE is the correct constant for use with glPolygonMode.
0

Share on other sites
ahh sorry, should read more carefully next time :D
0

Share on other sites
Quote:
Original post by bakery2k1
Quote:
 What would cause such a drop?

Do you have any unusual states enabled, such a smooth lines or wide lines?

Quote:
 Original post by Morpheus011I think you mean to be using GL_LINES not GL_LINE. Unless you mistyped it here, that could be your issue. Try changing it and see if that solves the problem :)

GL_LINE is the correct constant for use with glPolygonMode.

Not that I know of. I do call a larger line at one point, but I never call it unless I hit a key and when in LINE mode the lines are default 1.0.
0

Share on other sites
The line rendering mode is very slow; I suspect it's done in software.
0

Share on other sites
Quote:
 Original post by RavuyaThe line rendering mode is very slow; I suspect it's done in software.

In GL it's software? Because with DX it was maybe 60% slow down.
0

Share on other sites
Quote:
 Original post by RavuyaThe line rendering mode is very slow; I suspect it's done in software.

But it shouldn't be. There must be something wrong with the states...

0

Share on other sites
render direct as GL_LINES - not with polygonmode. i think you will get the same performance like in DX.
0

Share on other sites
1 fps sounds like software
make sure u havent got something enabled that can cause that eg antialaising, eg LINE_SMOOTH or something enabled
0

Share on other sites
Are you specifying LINE mode for both front and back facing triangles? I can imagine scenarios where mixed polygon modes will slow down - but if you specify LINE for both faces, it should remain on the fast path.

If you have a standalone test app which demonstrates the problem, I can take a look. Source code is preferable but an executable will suffice.
0

Share on other sites
Quote:
 Original post by goldAre you specifying LINE mode for both front and back facing triangles? I can imagine scenarios where mixed polygon modes will slow down - but if you specify LINE for both faces, it should remain on the fast path.

Do you have a dedicated hardware path for line rendering on your non-quadro FX product line, or do you simulate lines with thin triangles ?

I remember playing around with wireframe rendering some time ago, and it was indeed pretty fast on NVidia chipsets (I think it was the 6800). But it was horribly slow an ATI X1600 card I tried (which was no surprise, to be honest).
0

Share on other sites
Both GeForce and Quadro have line rendering hardware, although the latter is much faster.
0

Share on other sites
No AA, but I am still rendering with GLSL but calling these functions

if(gRenderMode)glPolygonMode(GL_FRONT, GL_FILL);	//GL_FRONT_AND_BACKelseglPolygonMode(GL_FRONT, GL_LINE);

and these are the hints I have set

	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);	glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);

Other than that nothing comes to mind what would cause this...

0

Share on other sites
as has been mentioned glPolygonMode(GL_FRONT, GL_LINE); + glPolygonMode(GL_BACK, GL_FILL); might be slow so use GL_FRONT_AND_BACK
0

Share on other sites
Quote:
 Original post by zedzeekas has been mentioned glPolygonMode(GL_FRONT, GL_LINE); + glPolygonMode(GL_BACK, GL_FILL); might be slow so use GL_FRONT_AND_BACK

I already did and nothing changes still 1 fps...
0

Share on other sites
Quote:
 Original post by RavuyaThe line rendering mode is very slow; I suspect it's done in software.

I also noticed that, I was using glPolygoneMode for cell-shading, which was very slow. It's much faster using lines instead.

Could it have something to do with requirements about rendering polygon edges? If you think about it, when rendering thick edges, the expected outputs would differ in the two methods.
0

Share on other sites
Line thickness is not the issue, at least on NVIDIA hardware. I'll be happy to solve this mystery as soon as MARS_999 provides a reproducer. :)
0

Share on other sites
Solution has been found and reason why, thanks to Gold.

Reason is
It’s an interaction between user clip planes and polygon mode.

Solutions are

You have a few options to work around this.
1) Use a vertex program instead of fixed function. You’ll have to implement your own user clipping, as that is part of fixed function. We don’t fall back in this case.

2) Use lines instead of triangles in line mode

3) Disable user clipping in wireframe mode

0

Share on other sites

Hello Mars, excuse me to bring this thread from the grave but I'm having a major performance drop while rendering in GL_Line mode. I try to find information on how to disable the user clipping and I couldn't find anything so far... so my question is, how do you disable the user clipping?

0

Share on other sites

@Neosettler: please create a new thread to address this question.

0

Share on other sites
This topic is now closed to further replies.
Followers 0

• 19
• 14
• 23
• 11
• 28