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
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 21 04-17-2024, 10:57 AM
Last Post: _Aka_
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Trigger Zones along Spline Mesh dlees9191 1 5 01-05-2024, 10:18 AM
Last Post: _Aka_

Forum Jump: