- Home /
Mesh deformation of a high poly 3D model causes FPS dropping
I have a high poly 3D model and I made a script to deform the mesh of this model (I'm using mesh collider), when the collision happens, the FPS drops to 5 for a while, is it because of the large number of polycount of my model? If so, what can i do to get rid of this problem? Thank you in advance.
It depends on what is involved.
Modifying a Mesh has a pretty variable cost. Yes, there's the factor of vertex/triangle/uv/normal counts (for all that apply). But there's more than just that.
Which means are you using to attach those Vector collections to the Mesh (as in, which functions are you calling)? How many vertices are in the Mesh (as a point of reference)? Are you feeding the normal values yourself or using RecalculateNormals() to do so?
Is this also affecting the Mesh on a Collider? If so, is this also a change being applied every frame?
There are a lot of questions to be asked, all of which have the potential to be relevant here. The more information you can provide, the better.