31-01-2018, 01:47 AM
(31-01-2018, 12:15 AM)josemendez Wrote: Hi Salvetori,
After taking a look at your scene, I determined that the cause are sudden spikes in the GC collector. This is because your character's skeleton has many more bones than the one in the sample scene, and generates a lot more garbage for the GC to collect periodically.
Luckily, there's a way to reduce the amount of garbage generated when retrieving the bones from Unity. Replace line 577 of ObiCloth.cs:
Code:for (int p = 0; p < sharedMesh.bindposes.Length; ++p){
with this one:
Code:for (int p = 0; p < rendererBones.Length; ++p){
That should fix the issue.
That did reduce the spikes in garbage collection, but unfortunately other spikes are still occurring.
I enabled deep profile and took a few screenshots.
[attachment=72]
[attachment=73]