Jump to content
  • Advertisement
Sign in to follow this  
Shane C

Something I always wondered... which is faster?

This topic is 2114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1. High polygon count with per-vertex lighting.

2. Low polygon count with per-pixel lighting.

Which is faster?

I would think that the more polygons you have, the better per-vertex lighting would look. And per-vertex lighting is not quite as expensive as per-pixel lighting. Which gives me a reason to make game models high-polygon. Well that's not the best reason, but still.

Share this post


Link to post
Share on other sites
Advertisement

Obviously the correct answer is: It Depends.

 

That's not really a helpful answer, so to come off the fence, I'd say that high polygon with per vertex lighting is likely to be faster, but only up to a point.

 

 

However, there's a limit to how high polygon you can effectively go. Even if you used hardware tesselators to try to get close to one vertex == one pixel, then you'd miss out on the massive optimisation of being able to do your lighting as part of deferred rendering, plus you can't really use normal maps properly, etc.

 

So I'd say that trying to go really high polygon to the point that you come close to matching per-pixel lighitng is going to be a losing battle and the per-vertex approach will end up with both lower quality and lower performance.

Share this post


Link to post
Share on other sites
The way things are going, GPUs are getting faster at computing stuff but the memory bandwidth can't keep up. Also the amount of hardware units, that can rasterize triangles, is limited. In general the chip real estate will be allocated in a way, that it best fits the "average usecase". So my guess (without looking up any numbers or performing any tests) would be that you get faster the closer you stay to the average use case and the less memory you read.

In the high polygon count vs pixel shading scenario I would assume that the latter is faster, because you read less memory, even with (compressed) normal maps, and are closer to the average usecase.

Share this post


Link to post
Share on other sites

I wrote a custom benchmark some years ago to compare this. Keep in mind that at the time hardware was very different from now but this does not really change the conclusion.

What the numbers seemed to suggest was that hi-poly count was indeed preferable. Unfortunately, it's not just a matter of framerate: in a real game we have to fit memory budgets, provide interactivity, maybe destructible meshes. Maybe we need extra bus bandwidth to upload new data.

So in general, even though vertex-lighting was about 2.5x faster I still decided to not build on that.

Today that hardware is unified it probably does not make any sense at all.

Edited by Krohm

Share this post


Link to post
Share on other sites

Also the amount of hardware units, that can rasterize triangles, is limited.

Triangle count is rarely the problem though. The number of polygons a graphics card can handle per scene is Graphics Card Core MHz number * 1 million * triangles/clock the graphics card can handle divided by framerate. My GTX 570 card which is a few years old, unoverclocked, can handle 12 million triangles with no LOD at 60FPS.

However, I agree with your overall point - more dedication is on pixel shader units than hardware which handles polygons. Because we need calculation power over polygon performance.

Share this post


Link to post
Share on other sites
Thanks for the help so far. I'll probably go with per-pixel lighting and a medium-high polygon count of 30k triangles a character, so I get the best of both worlds. The consequence of my choice might be that I'm doing too much and might end up with a Crysis level of performance.

I could implement normal-mapping or better normal-mapping instead, but I find normal-mapping just balances out the performance over more facets of the graphics card for (usually) increased performamce. Maybe I'm wrong. I'm going to see what my college studies say on the matter, eventually.

Share this post


Link to post
Share on other sites

 

The number of polygons a graphics card can handle per scene is Graphics Card Core MHz number * 1 million * triangles/clock the graphics card can handle divided by framerate.

 

 

Not it's not. That's the maximum number of triangles that can pass through the triangle setup unit. The actual performance of rendering those triangles depends on all kinds of factors: how much vertex work is done, how many interpolants are passed to the pixel shader, how many pixels a triangle gets rasterized into, whether MSAA is enabled, whether depth testing is enabled, whether depth writes are enabled, etc. etc. etc. In reality the only way to hit that theoretical peak is to artificially fabricate the ideal conditions at which the triangle setup unit can run at full tilt, which might not even be possible depending on the GPU.

Share this post


Link to post
Share on other sites

The number of polygons a graphics card can handle per scene is Graphics Card Core MHz number * 1 million * triangles/clock the graphics card can handle divided by framerate.


Not it's not. That's the maximum number of triangles that can pass through the triangle setup unit. The actual performance of rendering those triangles depends on all kinds of factors: how much vertex work is done, how many interpolants are passed to the pixel shader, how many pixels a triangle gets rasterized into, whether MSAA is enabled, whether depth testing is enabled, whether depth writes are enabled, etc. etc. etc. In reality the only way to hit that theoretical peak is to artificially fabricate the ideal conditions at which the triangle setup unit can run at full tilt, which might not even be possible depending on the GPU.
I know. And it is possible - I was reaching theoretical numbers on a HD 4870. I can't remember whether I tested the GTX 570 with 12 million polygons or more, but I think I have.

The tests I was using were simple but had shadows, models, and didn't use actual tesselation as we know it today but seemed to use some form of artificial polygon adding unless I'm mistaken. I don't know for sure because I didn't write the program.

Either way, my point is the card can handle the polygons. Even with multiple passes. If your card is slowing down, it's probably shader limited or bottlenecked by some other area. Adding triangles to what the graphics card can handle will increase performance rarely. That was my only point, that we aren't limited by polygons. Now whether the polygons put a strain on other parts of the graphics card or system is a whole other story, and why I ask my question.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!