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

Representing a procedural Voronoi graph

Discussion in '2D' started by Deleted User, Jun 23, 2014.

  1. Deleted User

    Deleted User

    Guest

    http://i.imgur.com/pKWL7UF.png?1
    https://googledrive.com/host/0B7vPiT3iPFmKMGc1OEVqalN6VnM/Web.html

    I've been rewriting AmitP's voronoi graph for Unity 2D. Part as a learning experience and part for a future project.
    http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

    Right now I'm doing setpixel to generate a texture on a quad. Cranking it up to 10K+ points it really starts to chug.

    I'm looking for ideas on how to speed this up. I originally thought of creating a mesh out of it, but then I'm not sure how to texture it procedurally without the same problems.

    In the future I want to be able to have the player modify the landscape and it react appropriately. Redrawing the texture every frame doesn't sound like a good idea. :D
     
  2. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
    Nice!
     
  3. Deleted User

    Deleted User

    Guest

  4. Deleted User

    Deleted User

    Guest

    I got bored over the weekend and updated an older version of this project to use mesh generation:

    https://github.com/Keshire/Unity-polygon-map-generation

    I'll probably continue to update this in my spare time. (especially since it hits the vert limit that unity supports for one mesh)

    be aware that the edge code (rivers/coastline) uses Vectrosity.