Skip to content

Commit

Permalink
Added easier to use SimplexNoise with resulting vector.
Browse files Browse the repository at this point in the history
Requires position and normal/direction vector input.
  • Loading branch information
dgsantana committed Jul 3, 2018
1 parent 7f7ecf9 commit 53725f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CurlNoise/Random.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ public static float Simplex_Noise3(Vector3 v)
// The result is scaled to stay just inside [-1,1]
return 32.0f * (n0 + n1 + n2 + n3); // TODO: The scale factor is preliminary!
}

[Description("Generates a 3 dimensions Simplex Noise aka Curl Noise. Returns position plus 'normal' multiplied by noise.")]
public static Vector3 Simplex_Noise3V3(Vector3 p, Vector3 n)
{
var result = Simplex_Noise3(p);
return p + (n * result);
}
}
}
}

0 comments on commit 53725f3

Please sign in to comment.