Search Unity

How can I make a moon terrain

Discussion in 'General Discussion' started by Baumlaeufer0815, Jun 18, 2021.

  1. Baumlaeufer0815

    Baumlaeufer0815

    Joined:
    Nov 7, 2020
    Posts:
    4
    I want to make a moon terrain, no moon planet, but procedural endless moon terrain, with craters and such. How can I make this? I know how to make procedural landmass generation, but how can I add craters and such.
     
    scottymclue likes this.
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,152
    Make a series of heightmap stamps for various sizes and shapes of craters and then give them random rotation before applying them to the terrain height.
     
    lmbarns, JoNax97 and stain2319 like this.
  3. Baumlaeufer0815

    Baumlaeufer0815

    Joined:
    Nov 7, 2020
    Posts:
    4
    How can I make heightmap stamps? Are they just normal heightmaps? I only found "terrain stamps" and how can I apply them with code, not with in the unity editor?
     
  4. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    murgilod is pretty smart but she doesn't know more than google.

    Punch that quoted sentence into google.

    Make it a little more precise: "heightmap 3d terrain how to"
     
  5. Baumlaeufer0815

    Baumlaeufer0815

    Joined:
    Nov 7, 2020
    Posts:
    4
    This don't work for endless terrain andI found nothing really on the internet. I have a Mesh Generator, that generates procedural endless moon terrain and I found nothing, that I can apply them with code. upload_2021-6-19_16-14-27.png

    This is a Example. The "craters" don't look like real craters. This craters was created with a noise map


    And it should look like this, but not as an planet and low poly graphics

    Or I am just dumb and the heightmap stamps or heightmap works and can apply them with code and endlessly.
     
    Last edited: Jun 19, 2021
  6. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    Look up "tiling terrain textures"

    also "procedural noise"

    also "heightmaps" and "displacement"

    and also "terrain materials unity"


    expect to spend at least a week learning everything necessary to make this work. Probably more like several months given that you don't seem to be familiar with basic terminology yet.

    The short answer is you use a tiling heightmap to displace vertices of the terrain. That is the simplest, most direct way. From there, once you understand that, lots of ways you can expand and modify.
     
    scottymclue and MadeFromPolygons like this.
  7. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,152
    I'll be honest, if you're struggling with some of the concepts here, you need to work on your problem solving skills more than anything.

    A heightmap is simply a texture (in this case) that has a value from 0-1 for each pixel that determines how high something is. If you're generating terrain, you already have control over its height. So, if you have a heightmap, you access the information there and use it to displace the terrain to form the crater.

    Can this be done programmatically? Sure. I guess. Doesn't really help in any meaningful way, is more complex, will likely be slower, but you could do that. The thing is, if you just plonk down and scale/rotate from 8 different crater height maps? You'll be saving time and processing power at the cost of the tiniest bit of memory.

    This is a simple thing to do programmatically. You're applying the stamps at runtime.
     
    scottymclue likes this.
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
    I recommend Map Magic 2. If you only need the heightmap generated it's completely free but there are paid add-ons that allow you to use it as a more complete world generation system.

    https://assetstore.unity.com/packages/tools/terrain/mapmagic-2-165180

    One of the older Map Magic tutorials covers craters.

     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    This is a bad example, because it is using an unmodified noise, and an unmodified noise is USELESS. To get anything usable from it you need to run it through multiple filters and mix multiple types of noise together.

    Here's an example of a procedural shader in blender:
    upload_2021-6-20_5-44-15.png

    Here's how it works.
    upload_2021-6-20_5-44-46.png

    Those are nodes mixing many things together.

    A moon surface might have comparable difficulty.

    Anyway, based off your reference photo, the starting point for the moon, would be :

    1. Produce a heightmap that looks like a rocky landscape.
    2. Pick few random points, and at them carve in HUGE circular "dents". Those are big craters.
    3. Pick many random points, do the same thing, except this time carve in smaller dents. Those are small craters.

    Normally to implement something like that you'd need a node-based system, but it is possible to work without.

    It is also possible that there are modeling tutorials for that, and if you find ones that do not use nasa's photo of the moon, you could try using them as a reference point.
     
    scottymclue and Antypodish like this.
  10. scottymclue

    scottymclue

    Joined:
    May 13, 2021
    Posts:
    107
    What a fantastic response from very knowledgeable people! It's great to be here.

    My daughter mentioned watching something on youtube which may or maynot be useful to the quandary at hand. Hope it is not too late.