Search Unity

Procedural Planets

Discussion in 'General Discussion' started by kaskiU, Mar 22, 2017.

  1. kaskiU

    kaskiU

    Joined:
    Aug 6, 2013
    Posts:
    50
    How I should create planets and how I can divide mesh data into even chunks? I tried to create an octahendron (planet that is far far away) and just split triangles when player gets closer. I wanted bigger planets (and more details) so I hit the 65k vertlimit. I tried to create a new gameobject and forward over 60k triangles there. It works but I don't think that is efficient or "correct" way to do this. I want chunks (that are evenly distributed if possible) to have more detail if they are closer the player. With my way it would be just big mess or probably just not work.

    I am having problems to find a good technique and the actual idea of how they should work. Main problem for me is that I want players to be able to fly from space into the surface of the planet which will need a good LOD and chunking of planet surface. As for textures, I think I will send information to shader what position has what texture and blend between different textures.

    Any idea how others have done it?
     
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Well the mesh object I think has a limit of how many triangles, so you HAVE to break it up into multiple meshes if you want to have more triangles. No other choice.

    You could always try doing it with realtime fractals ;-)
     
  3. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Why would you need a planet with that many details from geometry alone? I could get the same exact detail with a 32 segment sphere with a height and normal map applied to it.

    EDIT: Like if you need some height formation that a height map can't do, then occasionally just place a mountain mesh somewhere then do the same thing - normal and height map on it.

    EDIT 2: Believe it or not - adding a Smooth to the mesh makes a world of difference as well.
     
  4. kaskiU

    kaskiU

    Joined:
    Aug 6, 2013
    Posts:
    50
    Thank you for your replies.

    I want planets to be near real world size where people can land into it and do stuff so 65k limit will certainly break. I know I can't create mesh over 65k verts which is why I was talking about chunks. As you can see from my images I got it working. However, I would like to split triangles which are only close the player to which my current code won't bend. I just split them regardless of where the player is.

    I found an image with google image search, this is what I want. One big planet which from far far away would be something like octahedron and getting more triangles when player come nearer. When he lands, only chunks near him are high detail. Any idea how I can achieve that?
     
    Last edited: Mar 22, 2017
  5. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
  6. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @kaskiU Why not do what every other game does? Have it when you enter the atmosphere, it gets kind of cloudy and then transitions to a Terrain? The hard part then is figuring out if you move 2,000 Miles where on the planet it should put you in relation to where you were before when leaving the planet.

    Game Design isn't about trying to make things as big as real life, it's about finding the tricks to give it the illusion of that. No computer on Earth could handle a real planet sized planet in 1 mesh, or even 10 meshes. It's about finding the right tricks to illuminate a plausible outcome.

    It's not easy, but you'll be more happy with it once you get it to actually work.
     
    Tzan likes this.