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.

Resolved Perlin noise, too larger differences between points

Discussion in 'World Building' started by bigassnoob, Jan 19, 2023.

  1. bigassnoob

    bigassnoob

    Joined:
    May 26, 2020
    Posts:
    7
    Hi,

    I'm trying to use Perlin noise to build a world, problem is, the values between points on the Perlin map are too big, for example, it goes from .3 to .4, between points, which is too large of a jump, is there a way to solve this?

    Kind regards
    A big ass noob
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,409
    can you show that part of the code where it calculates perlin?
     
  3. bigassnoob

    bigassnoob

    Joined:
    May 26, 2020
    Posts:
    7
    I'm using Mathf.PerlinNoise, other code doesn't influence the value, I'm passing in rather small values, points which should be different tend to be on the same point on the map, I just need more sample points on the map.
     
    Last edited: Jan 19, 2023
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,601
    What values are you passing to the noise function?
     
  5. bigassnoob

    bigassnoob

    Joined:
    May 26, 2020
    Posts:
    7
    Coordinates in world space, divided by a large number, like 500, so 16, 0, 16 in word space would be 0.032, which is too small for the perlin map, the next 5 coordinates are gonna get the same perlin value, which means the terrain isnt smooth.
     
  6. RZGames_Jethro

    RZGames_Jethro

    Joined:
    Jul 6, 2017
    Posts:
    63
    Code (CSharp):
    1. for (int k = 0; k < x; k++)
    2. {
    3.     for (int l = 0; l < z; l++)
    4.     {
    5.          float hi = Mathf.PerlinNoise(xStart + (float)k/ x, zStart + (float)l /z);
    6.     }
    7. }
    where x and z are terrain width and length
     
  7. bigassnoob

    bigassnoob

    Joined:
    May 26, 2020
    Posts:
    7
    I believe the same problem would remain, thank you though.
     
  8. bigassnoob

    bigassnoob

    Joined:
    May 26, 2020
    Posts:
    7
    Hello again,

    Just wanted to thank the people who tried to help, but I've managed to solve the issue by layering noise in a bit of a unorthodox way.

    Kind regards
    A big ass noob