Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rolling sphere over generated mesh
#12
I have used the Profiler.. and looked into some things.. here is what I have just checked a few minutes ago:

- went into "CreateMesh.cs" - changed createMeshes() to coroutine - updated this part as such:

Code:
for (int vm = 0; vm < MY_MESH.Count; vm++)
{
      if (MY_MESH[vm].Count < 65535)
      {
            CGVMesh vmesh = MY_MESH[vm];
            writeVMeshToMesh(ref vmesh);
       }
       else
            exceededVertexCount++;
       yield return new WaitForSeconds(.2f);
}

- after that, same thing done to UpdateColliders() - updated to this:

Code:
for (int r = 0; r < m_MeshResources.Count; r++)
{
    if (!m_MeshResources.Items[r].UpdateCollider(Collider, Convex, Material))
         success = false;

    yield return new WaitForSeconds(.2f);
}

These changes already diminished the problem by a large margin. It also did implicitly create a visible update sequence (I could see parts of the road being updated, one after the other - instead of the whole thing - makes sense).
There's other places that could benefit from the same idea I guess, but I don't really have a good enough overview of how everything is put together, so.. if I for instance change the WaitForSeconds to ".4f", there's a big delay to setting colliders.. clearly there's more synchronization needed for everything to work.
Anyways, based on the current results, I do believe it is the way to go for better performance.
Reply


Messages In This Thread
Rolling sphere over generated mesh - by ioanma - 11-12-2015, 10:24 PM
RE: Rolling sphere over generated mesh - by Jake - 11-13-2015, 07:57 AM
RE: Rolling sphere over generated mesh - by Jake - 11-15-2015, 06:56 PM
RE: Rolling sphere over generated mesh - by Jake - 11-15-2015, 09:22 PM
RE: Rolling sphere over generated mesh - by Jake - 11-16-2015, 07:07 PM
RE: Rolling sphere over generated mesh - by Jake - 11-17-2015, 07:51 PM
RE: Rolling sphere over generated mesh - by ioanma - 11-17-2015, 08:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to generate UVs along deformed and copied mesh? kubak 1 682 03-18-2026, 08:34 PM
Last Post: _Aka_
  Replace deform mesh on volume spots Kokoriko49 1 2,627 06-09-2025, 06:49 PM
Last Post: _Aka_
  Mesh Generation between two splines vatan 4 4,216 02-14-2025, 07:11 AM
Last Post: vatan
  Create Mesh Node, Make Static Options rickgplus 1 2,092 01-23-2025, 10:12 AM
Last Post: _Aka_

Forum Jump: