|
|
The normal generation thing on gamedev.net is pretty much as nice an effect for smooth shading as your going to get in run-time, I think. For a regular grid mesh, however, you can get a very convincing shading normal per vertex happening though, by generating the normal for a vertex by the triangle defined by that vertex, the vertex south of it, and the vertex to the right of it (excluding the south and right edges, I guess). So you have Tri(A,B,C) - you can calculate a normal for that like so: (It's been a while, but I think this is it..
Normal=Normalize(CrossProduct(B-C,A-C));
And that should be cheap enough to generate on the fly at pretty good speeds. Actually - depending on the order of A B and C, I think the normals might need flipping. Hope that helps.
|