Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Using Tilemap Tiles on a 3D Mesh

Discussion in '2D' started by iamlukeamiller, Mar 21, 2020.

  1. iamlukeamiller

    iamlukeamiller

    Joined:
    Mar 3, 2020
    Posts:
    11
    In my current learning project, I'm working with some 2D tilemap assets to built out a 2D isometric world. Going full animated 2D sprites, which so far is working out really well (thanks to some help here on the forums, especially). Working on the in-game map / terrain, I've been wanting to use my 2D tilemap assets to layer on top of a procedurally generated 3D mesh.

    With a grayscale heightmap of the world I'm building, I know I'll be procedurally generating my worldmap mesh in no time, with the added step of learning how to break my almost 7500 x 5000 square tile world up into very necessary chunks in the interest of both performance and Unity's vertex-per-mesh limit. All that I'm confident I can do with a little learning and sandboxing.

    However, I'm curious to learn if it's possible to layer tiles onto that 3D mesh, leaning on Unity's built-in tilemap system at all? I have a 1-pixel-per-tile map of my world as well, where each pixel maps directly to a terrain tile. I know I could use that to generate a texture, or to even map each pixel to a tile / texture. The end result would be a smoothly rendered 3D terrain using my 2D tiles, and in my tile generation process saving data to that tile (or to an array matched to the tile's WorldToGrid coordinates) with some very simple attributes for each.

    I think the answer here is "yes, Luke, and you are answering your own question above," but I wanted to find out from those more experienced: Is it possible after procedurally generating a 3D mesh for terrain to procedurally layer tiles over each quad of that mesh? And if so, is there a method you'd recommend I learn more about?
     
  2. neozack

    neozack

    Joined:
    Mar 20, 2020
    Posts:
    5
    Any luck?