Has anyone found some mesh-normals finding code that produces nice results in unity, as good as the recalculatenormals? Because the built-in function cannot be multi-cored, held in an array prior to writing, edited, it has bugs along seams, etc.
could you prevent me having to search around the Internet searching for and converting codes for many hours in order to find one? do you know a really good code for it in C++?
please post what you have:roll_eyes: it would be heavily of you
I’m not sure if I correctly understand your problem. . .but I think it may be a matter of averaging the normal when a vertex is shared by multiple faces. I may have C++ code lying around, I just have to look for it. Since DirectX has this I didn’t have to use my own, OpenGL on the other hand didn’t, and I did
That last bit is to see if you’re following long.
Would you please post a picture of what you have.
Is this a preprocessing issue or something you are trying to do at runtime?
Although the method mentioned does produce a normal, it does not account for when the same vertex is shared among multiple faces that may be oriented differently.
Do a first pass with what BFGames wrote for each, so that you can get naive normals. Then take all the triangles around a vertex that are not on the opposite side of a seam edge, or have a naive normal that is over the crease angle limit, and do what Dantus wrote, and add them together scaled with the edge weights specified. Now normalize the result. Done.