Search Unity

dealing with large meshes (terrain)

Discussion in 'Editor & General Support' started by steveh2112, Jan 20, 2021.

  1. steveh2112

    steveh2112

    Joined:
    Aug 30, 2015
    Posts:
    314
    i am writing an excavator simulator and for the terrain i'm using several tiled 4x4m meshes with 5cm vertex spacing. i guess i could use a height map based system but i read meshes are more efficient.

    anyhow, i can deform the mesh and change texture image at run time to show where i'm digging.

    problem is when i cross the boundary from one mesh to another, straddling between 2 or perhaps 4 meshes is going to complicate the hell out of all my math. so i'm wondering what i can do to ensure that i only have to deal with a single mesh tile at a time.

    one thought is to create an 2nd set of meshes at 2m (half tile) x and z offset from each other (which would be disabled by default) then if my excavator bucket ends up close to a mesh boundary, i switch to the 2nd set of meshes. there would likely be a bit of a performance hit as build the 2nd set of meshes based on the working set but i guess i could set that copy to run as a coroutine or something

    what do you all think, sorry about the vague question, just wondering if there is a better way than my 2nd set of meshes idea?

    thanks