#Mesh to Unity Terrain

1 messages · Page 1 of 1 (latest)

umbral wind
#

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

sudden gyro
umbral wind
#

sounds "easier" to generate the heightmap from that

sudden gyro
umbral wind
#
... map "altitude" ... 
        public long width;
        public long height;
        public Cell[] cells;
        public string version;
        public struct Cell {
            public Vector4 Heights;
            public byte type;
        }
sudden gyro
umbral wind
#

yes

sudden gyro
#

If it is any similiar to unity (grid based heights) you could try directly converting that first

#

Look at TerrainData.SetAlphamaps docs etc

umbral wind
#

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

sudden gyro
# umbral wind

looks like you'll be able to convert it to unity terrain, at least geometry-wise

#

I guess iterate over cells

umbral wind
#

yea, gotta figure how to deal with the textures tho

sudden gyro
#

how is it stored?

umbral wind
#

atlas

sudden gyro
#

I mean how does it know where is grass, where is dirt etc

#

or is it just a pre-painted texture?

umbral wind
#

pre painted

sudden gyro
#

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

umbral wind
#

thank you for enlightening me

#

looks like this is going to the bottom of the backlog 😂

sudden gyro
# umbral wind

these meshes look good though, what was the problem with mesh-generated terrain?

umbral wind
#

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