0

Does anyone know how I might be able to generate the following kind of noise?

  • Three inputs, three outputs
  • The outputs must always result in a vector of the same magnitude
  • If it receives the same input as some other time, it must return the same output
  • It must be continuous (best if it appears smooth, like perlin noise)
  • It must appear to be fairly random

EDIT: It would also be nice if it were isotropic, but that's not entirely necessary.

4

1 回答 1

0

我找到了一种方法,它可能不是很快,但它可以完成工作(这是一种类似 c 的伪代码,旨在使移植到其他语言变得容易)。

vec3 sphereNoise(vec3 input, float radius)
{
    vec3 result;
    result.x = simplex(input.x, input.y); //could use perlin instead of simplex
    result.y = simplex(input.y, input.z); //but I prefer simplex for its speed
    result.z = simplex(input.z, input.x); //and its lack of directional artifacts

    //uncomment the following line to make it a spherical-shell noise
    //result.normalize();
    result *= radius;
    return result;
}
于 2013-06-19T22:12:30.920 回答