Jump to content

  • Log In with Google      Sign In   
  • Create Account

glPolygonMode slows down[solved]


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • This topic is locked This topic is locked
23 replies to this topic

#1 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 31 August 2006 - 07:03 AM

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]

Sponsor:

#2 Enrico   Members   -  Reputation: 316

Like
0Likes
Like

Posted 31 August 2006 - 07:11 AM

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).

#3 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 31 August 2006 - 07:19 AM

Quote:
Original post by Enrico
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).


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

#4 Morpheus011   Members   -  Reputation: 309

Like
0Likes
Like

Posted 31 August 2006 - 07:20 AM

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 :)

#5 Promit   Moderators   -  Reputation: 7197

Like
0Likes
Like

Posted 31 August 2006 - 07:23 AM

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.

#6 bakery2k1   Members   -  Reputation: 712

Like
0Likes
Like

Posted 31 August 2006 - 07:24 AM

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 Morpheus011
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 :)


GL_LINE is the correct constant for use with glPolygonMode.


#7 Morpheus011   Members   -  Reputation: 309

Like
0Likes
Like

Posted 31 August 2006 - 07:41 AM

ahh sorry, should read more carefully next time :D

#8 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 31 August 2006 - 07:51 AM

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 Morpheus011
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 :)


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.

#9 Ravuya   Moderators   -  Reputation: 127

Like
0Likes
Like

Posted 31 August 2006 - 08:12 AM

The line rendering mode is very slow; I suspect it's done in software.

#10 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 31 August 2006 - 08:21 AM

Quote:
Original post by Ravuya
The 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.

#11 Enrico   Members   -  Reputation: 316

Like
0Likes
Like

Posted 31 August 2006 - 09:28 AM

Quote:
Original post by Ravuya
The 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...



#12 __win__   Members   -  Reputation: 188

Like
0Likes
Like

Posted 31 August 2006 - 10:22 AM

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

#13 zedzeek   Members   -  Reputation: 528

Like
0Likes
Like

Posted 31 August 2006 - 04:26 PM

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

#14 gold   Members   -  Reputation: 412

Like
0Likes
Like

Posted 01 September 2006 - 03:22 AM

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.

#15 Yann L   Moderators   -  Reputation: 1798

Like
0Likes
Like

Posted 01 September 2006 - 05:10 AM

Quote:
Original post by gold
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.

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).


#16 gold   Members   -  Reputation: 412

Like
0Likes
Like

Posted 01 September 2006 - 07:33 AM

Both GeForce and Quadro have line rendering hardware, although the latter is much faster.


#17 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 01 September 2006 - 11:44 AM

No AA, but I am still rendering with GLSL but calling these functions


if(gRenderMode)
glPolygonMode(GL_FRONT, GL_FILL); //GL_FRONT_AND_BACK
else
glPolygonMode(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...



#18 zedzeek   Members   -  Reputation: 528

Like
0Likes
Like

Posted 01 September 2006 - 03:21 PM

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

#19 MARS_999   Members   -  Reputation: 1281

Like
0Likes
Like

Posted 01 September 2006 - 03:28 PM

Quote:
Original post by zedzeek
as 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...

#20 johdex   Members   -  Reputation: 247

Like
0Likes
Like

Posted 02 September 2006 - 12:22 AM

Quote:
Original post by Ravuya
The 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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS