I have a terrain that is generated procedurally. After each few frames I add 20 new vertices to my mesh. After setting new UVs and triangles, I perform RecalculateNormals(). The bad thing is that normals are recalculated for the whole mesh, not only for new vertices. The question is, will I get any benefit in terms of performance if I’ll calculate normals manually only for new vertices? Is there any way I can recalculate normals automatically for newly added vertices only?
Thanks!
If you’re building new geometry every frame? That stuff adds up.
If you’re calling this once, and that’s it? Don’t worry about it.
This is one of those calls that isn’t “free” for performance, but is usually fine as long as you don’t overuse it.
I believe RecalculateNormals
applies to the whole mesh, but if you’re in a pinch you can calculate and set normals directly according to any algorithm you’d like.