Unity3D tips: Procedural mesh generation/debugging/performance

Saw this via twitter:

Procedural meshes in Unity

I really liked the double-buffering meshes idea.

Comments

  • Any idea if there is a recording of the talk to go along with this? Or more notes or something. I don't understand the advantage of double-buffering the mesh from that slide :(
  • roguecode said:
    Any idea if there is a recording of the talk to go along with this? Or more notes or something. I don't understand the advantage of double-buffering the mesh from that slide :(
    You could ask via twitter? I'm not sure what the benefit is either, but it's a thing I've never tried that's quite an easy switch, so I'll give it a go.
  • afaik it's a mobile-specific thing that has to do with Mesh.CreateVBO being really slow for some reason.

    It's listed in the Unity docs as a mobile optimization, though it also doesn't say there why it is.

    Old (2012) forum post where someone did tests
    Unity docs entry (number 13)
  • edited
    This is just a guess (I'll call it an educated one though :P), but I believe editing a Mesh that is assigned to a MeshFilter immediately uploads data to the GPU. The bus to the GPU is a huge bottleneck and you should try to minimise this traffic or at least batch it where you can. So if you assign all your new data to an unbound Mesh, this operation takes place on the CPU side - then you can upload all the new data in one go. Fewer transfer calls, moar speed.

    It might also allow Unity to use threading more efficiently. Unity has a thread for rendering things, and this thread will be blocked if you are changing render-related data, or your upload calls will be blocked while Unity is rendering. Doing this offline first ensures that you don't constantly have to wait for drawing to finish.
  • For the last couple of weeks I've been trying to reproduce HexPlanet (with the ultimate aim of reproducing the Polygonal Planet Project) but I'm finding orientating my UVs to be serious challenge. Why do I only see this now!?
    Thanked by 2Boysano TheFuntastic
  • Fengol said:
    For the last couple of weeks I've been trying to reproduce HexPlanet (with the ultimate aim of reproducing the Polygonal Planet Project) but I'm finding orientating my UVs to be serious challenge. Why do I only see this now!?
    Have you had a look at this?
    https://github.com/alprkskn/RandomPlanetGenerator
    Thanked by 1petrc
  • Awesome! Must resist urge to switch to a different project...

    I've wanted to generate procedural meshes for a project before but didn't really get to that part of it yet. Bookmarking this now so I can find it again once I do get to it, but for now I need to stay focused on one thing.
  • Very cool slideshow, thanks for sharing.
  • So, I've been working on a mesh drawing thing in Unity.

    image

    The hardest part like the slides mention is making the tris. This is a great resource for that.
Sign In or Register to comment.