Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

3d perlin noise unity

public static float Perlin3D(float x, float y, float z, float density, float scale){
  float XY = Mathf.PerlinNoise(x, y);
  float YZ = Mathf.PerlinNoise(y, z);
  float ZX = Mathf.PerlinNoise(z, x);
  
  float YX = Mathf.PerlinNoise(y, z);
  float ZY = Mathf.PerlinNoise(z, y);
  float XZ = Mathf.PerlinNoise(x, z);
  
  float val = (XY + YZ + ZX + YX + ZY + XZ)/6f;
  return val * scale;
}
 
PREVIOUS NEXT
Tagged: #perlin #noise #unity
ADD COMMENT
Topic
Name
1+4 =