- Home /
RecalculateNormals optimization
Have been working on some real-time updating water, using meshes and RecalculateNormals() method wasn't that demanding, when my mesh had around 600 triangles, but once I've increased the number significantly, it's been having an awful lot of trouble, taking up to 40ms a frame to update it.
I have implemented LOD for the mesh, and dropping it down significantly, obviously increases the performace a lot, but the mesh starts looking a little weird. Either way, I was wondering, if there might be a simpler algorithm to recalculate normals. Was thinking about implementing the recalculation in a different thread, where the thread could pass it into a List of sorts, which the main thread could pick up without much trouble (have not dabbled with threading at all, just have seen a few tutorials about it here and there), but the RecalculateNormals method does not return the list, but instead recalculates it inside of a mesh itself, and putting such a method inside of a thread doesn't seem 'healthy' practice.
Implementing it into an update that's less frequent wouldn't be good either, because while it'd be fast for a few frames, it would spike all the time.
Your answer
Follow this Question
Related Questions
Differentiate an overlapping collision from just touching 1 Answer
Determine whether or not model is "inside out" 2 Answers
Getting meshes to render properly, and coloring triangles of a mesh 0 Answers
Shader wants normal , but the mesh does not have them 2 Answers
Combining Mesh at Runtime via Script causes temporary FPS drop 1 Answer