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. Dismiss Notice

I'd like to combine multiple 2D meshes into one, then use as a sprite mask....

Discussion in '2D' started by Valynna, May 26, 2022.

  1. Valynna

    Valynna

    Joined:
    Apr 1, 2021
    Posts:
    39
    So if you could ignore what are clearly WIP visuals here, essentially what I'm doing here is procedurally generating more interesting ground / soil colors for my game.

    https://store.steampowered.com/app/1826120/Hive_Defender is what it looked like before with prototype visuals.

    Right now I'm blending all of the tiles together via alpha channels and perlin noise sprites, which works well -- but there's all this little bit hanging off the sides.



    I have about 150+ 2D meshes in the shape of hexagons which use 6 triangles (7 points) each.

    I'd like to somehow combine all of these meshes together into some kind of super mesh, and then use that mesh as a sprite mask such that only sprites within this big mesh are displayed.

    I then intend to layer on ground texture, cracks, pebbles, etc... using the same method.

    Any idea how to actually do this? I've been a few hours browsing the web, but I think there's probably a very specific term for what I'm trying to do but I can't find it.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,768
  3. Valynna

    Valynna

    Joined:
    Apr 1, 2021
    Posts:
    39
    Yeah the noise textures are sprites.

    Maybe I can find a method to convert a mesh into a sprite, then combine all the smaller meshes into one big mesh, then turn that giant mesh into a sprite, then use that as a sprite mask.