#Mesh to Unity Terrain
1 messages · Page 1 of 1 (latest)
Well... It seems to me that sampling it with raycasts is a good option
I have a data class holding the cells of the map though, including each cell's height
Yeah why not - sounds kind of straightforward
sounds "easier" to generate the heightmap from that
...compared to other options like rendering the height with an orthographic camera and custom shader
... map "altitude" ...
public long width;
public long height;
public Cell[] cells;
public string version;
public struct Cell {
public Vector4 Heights;
public byte type;
}
Oh wait you have cell data of the source map?
yes
If it is any similiar to unity (grid based heights) you could try directly converting that first
Look at TerrainData.SetAlphamaps docs etc
I can show how it looks, 1sec.. let me boot unity
when we generate the meshes, unity complains about the verts amount so we had to split the ground into several pieces
project is open source though, if you'd like to take a look https://github.com/guilhermelhr/unityro and we load the ground at https://github.com/guilhermelhr/unityro/blob/develop/UnityClient/Assets/UnityRO.io/Loaders/GroundLoader.cs
looks like you'll be able to convert it to unity terrain, at least geometry-wise
I guess iterate over cells
yea, gotta figure how to deal with the textures tho
how is it stored?
atlas
I mean how does it know where is grass, where is dirt etc
or is it just a pre-painted texture?
okay so its a sort of a tilemap
don't know the best way to transfer that to unity terrain, since it uses splatmaps to blend between textures
thank you for enlightening me
looks like this is going to the bottom of the backlog 😂
these meshes look good though, what was the problem with mesh-generated terrain?
none, just wanted to see if it was feasible enough to give it a try and see if I could get some performance out of it