Search Unity

How does No Man's Sky break apart terrain when you harvest it?

Discussion in 'Editor & General Support' started by Adam_Reed, Feb 17, 2020.

  1. Adam_Reed

    Adam_Reed

    Joined:
    Feb 17, 2020
    Posts:
    1
    This is my first time posting here on the Unity forums, but I have been racking my brain and googling everything I could think of to figure this out for a while now... I eventually want to create a mining system similar to No Mans’s Sky’s but first I need to understand how it is that they cause whole mountains within the terrain to break down and reshape as you mine into it. Does the mining laser directly reshape and scale the mesh vertices of the mountain/terrain’s game object in relation to the point of impact from the mining laser or what? And if so, how do they do it?

    Please help
     
  2. daythatidie88

    daythatidie88

    Joined:
    Oct 19, 2020
    Posts:
    9
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    DevDunk likes this.
  4. daythatidie88

    daythatidie88

    Joined:
    Oct 19, 2020
    Posts:
    9
    Yes, marching cubes algorithm can be used in compute shaders. I found this sample project https://github.com/keijiro/ComputeMarchingCubes

    Also if you are planning to use voxel system in your game, I encourage you to create your own system in order to be able to control it.
     
  5. daythatidie88

    daythatidie88

    Joined:
    Oct 19, 2020
    Posts:
    9
    pmoodie likes this.