Sign in to follow this  
spock83

Flat shading still useful?

Recommended Posts

spock83    100
Hello everyone, I would like to ask your opinion whether flat shading is still useful. Theoretically it should offer slight performance benefits over Gouraud shading since only one vertex is shaded for each triangle, as opposed to three. For desktop GPUs, there might not be visible benefits, but for mobile devices (handphones, PDAs) would there be a performance increase? A flat shaded model would look poor, but even with simple texture mapping, the results should look OK. Let's assume that for the above case, the rendering is geometry limited.

Share this post


Link to post
Share on other sites
osmanb    2082
It's only going to help if you're interpolator bound, and even then I doubt it would have any impact at all. The GPU still needs to interpolate positions, and (in your example) texture coordinates. The work you save has nothing to do with the vertices (well, other than the trivial operation of passing vertex color through to the interpolators). Perhaps if you're doing per-vertex lighting ... but even then I have a hard time imagining how a super-low-end GPU is going to have the facilities to conditionally strip out *only* the parts of the vertex shader that contribute to color ... and only on 2/3 of the vertices. Even if it could do that, most GPUs shade in groups of vertices/pixels, so it wouldn't save anything at all.

Share this post


Link to post
Share on other sites
rouncED    103
If your writing a software engine, yeh flat shade helps almost 400% over texturing... so if you dont mind a psychodelic look to your game, if your writing in software its still an option. :)

Always remember, micro poly engines in software are almost always flat shaded (zbrush is only flat shaded) cause you just colour the verts for the texture anyway. I would always even only draw boxes around the points just to go that little bit faster.

What your asking is like saying, "do you think people would still buy a 3d line vector game?" I dunno... what if the game's still fun?

Always remember, xwing on the pc was only flat shaded, and back then it was great.

flat shaded

flat texturing

normal mapping

displacement mapping

Share this post


Link to post
Share on other sites
spock83    100
Thanks for the input..

osmanb - Yeah, I was thinking of per-vertex lighting. If only 1/3 vertices are required to be shaded, the 2/3 computations for lighting at the vertex shader is saved, so there should be a performance increase for that shader right? Even if the GPU can shade groups of vertices at a time, the vertices from each 'group' can be from different triangles, since each vertex can be treated independently

I'm not sure what you mean by "how a super-low-end GPU is going to have the facilities to conditionally strip out *only* the parts of the vertex shader", but I think you meant the shader programming. Let's assume that the programming technicalities can be circumvented.

rouncED - Yup, there's no reason for this on desktop GPUs. But for power and performance limited handphone GPUs, it could still be of use.

Share this post


Link to post
Share on other sites
phresnel    953
If your average triangle's size is very small on screen, not more than a few pixels, than there is no (big) observable difference, and you might save a handful of sizeof(float) bytes.

Share this post


Link to post
Share on other sites
Scoob Droolins    258
Sometimes smooth shading is just wrong, it's a bit of a hack to make a polygonal surface look continuous. But some mesh types, like a cube or anything with a sharp edge, look wrong with averaged vertex normals and smooth shading. In that case, flat shading looks a lot better. In practice, rather than use actual flat shading, you'd probably just break the edge by duplicating verts with different normals. There are probably more clever things you could do with face normals to simulate flat shading.

Share this post


Link to post
Share on other sites
spek    1240
When modelling, flat shading gives you a better a view on the "wrong" normals or misplaced vertices. With smoothing the noisy vertices get blended with the rest, while with flat shading they are (painfully) obvious. So if you need a good reason to use it --> debugging / modelling. Don't know about performance gains on lower end hardware.

Rick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this