Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to efficiently generate a large number of 2D meshes(3000-10000) from texture

Discussion in 'General Graphics' started by Kingfish2020, Sep 23, 2021.

  1. Kingfish2020

    Kingfish2020

    Joined:
    Aug 2, 2021
    Posts:
    9
    In my game, I need to generate a large number of 2D meshes from a texture that is not a sprite, just a PNG(pixel map)

    a sample that is taken from that PNG:

    I need to generate each mesh from each region(that may contain 'holes' or black background) in the image
     
  2. Kingfish2020

    Kingfish2020

    Joined:
    Aug 2, 2021
    Posts:
    9
    I hope this image does not break.
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    725
    If I understand you correctly, you want something like the Marching Squares algorithm.