Search Unity

Convert huge 3D image/scan mesh + texture to dynamic LOD

Discussion in 'World Building' started by SubstituteEmperor, Nov 12, 2018.

  1. SubstituteEmperor

    SubstituteEmperor

    Joined:
    Nov 12, 2018
    Posts:
    2
    I have had a drone fly around an island and scan/take pictures of it to create a 3D environment of the island and I've successfully made it into a single giant mesh (with the texture go along with it), but the island is too big to render as a whole without LODing it to be useful, since the idea is to use it with VR.

    Is there any way I can either divide the mesh and texture and then LOD it to a useful level or apply something akin to the Base Map Distance setting used on terrain? Do consider that trees, bushes and other terrain is also included in the mesh, and I don't really have the time to cut every tree and house from the mesh and figure out how to cut it from the texture to fit well.

    I have thought of using Blender to divide the whole island into multiple meshes and try to fix the texture to fit decently, but since I will LOD it, I might lose some ground between meshes on the low poly LODs, which isn't an option.

    Thank you in advance.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Chopping it up into tiles is probably gonna be the win but I'm not sure of the optimum workflow.

    If I had to guess it would be:

    - chop the highest-resolution model into tiles
    - apply the Blender3D decimate modifier to take it down a bunch, maybe down to 25% of original?
    - rechop that mesh into the same-sized tiles

    These lower-res tiles might need a downward-hanging flange added around their lowest perimeter verts to keep from seeing through them at the seam

    Lather rinse repeat for however many LODs you want.
     
  3. SubstituteEmperor

    SubstituteEmperor

    Joined:
    Nov 12, 2018
    Posts:
    2
    What tool would you suggest I'd use? Since I have so many vertices I can't use loop cutting and doing manual cuts and trying to keep them the same size seems like a daunting task.

    Equally, how do I add a flange to the bottom of them?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Good question. There's gotta be some tools out there already to chop stuff up like this but the only ones I used were in custom console engines back in the day. I worked with the Baldur's Gate Dark Alliance 2 Snowblind engine and it automaticlaly did this on level imports, and I imagine lots of other games need it. I think Escape From Tarkov is actually doing it with real Unity3D terrains so you might find some discussions on their dev blogs, not sure.

    If you want to do it yourself, I imagine in Blender3D you could do it with some custom scripting and a movable "box" that is your boolean modifier cutter, then just iterate it across the entire world in the X and Y (blender's coordinates) and chop out each piece, save it as a separate X/Y numbered .blend file, etc.

    As for fabricating the flange, I guess you could do it at runtime based on studying the verts along the edges of a given cell, then construct the flange hanging down like a skirt. Or you could integrate it into a custom Blender export script that does it... I imagine the solution ultimately depends on the characteristics of your original data: noisiness, density, etc.

    If you wanna get away from booleans I suppose you could just analyze the entire mesh and bucket it into squares: a triangle would go into a square as long as any of its verts are in there. Or you could get clever and do the boolean chopping yourself... either way, it's some engineering!
     
  5. jeesty

    jeesty

    Joined:
    May 2, 2019
    Posts:
    8
    Did you ever figure out how to do this? We have huge 150 meter tall trees that we dynamically create which we need to cut up similarly. We would prefer to do it at runtime, but if we had to do it at pre-processing we could.