【问题标题】:Perlin noise infinite generation/tiling?Perlin 噪声无限生成/平铺?
【发布时间】:2012-03-08 12:34:56
【问题描述】:

我从Here 得到了柏林噪声算法,我想知道是否有办法使地形无限。问题在于这个函数(Java):

float[][] GenerateWhiteNoise(int width, int height, int seed)
    {
        Random random;
        random = new Random(seed);
        float[][] noise = new float[width][height];
     
        for (int i = 0; i < width; i++)
        {
            for (int j = 0; j < height; j++)
            {
                noise[i][j] = (float)random.nextDouble() % 1;
            }
        }
        
        System.out.println("Generated White Noise with seed:"+seed+"; xOffset:"+xOffset+"; yOffset:"+yOffset);
     
        return noise;
    }

有谁知道如何使这个函数的随机生成器依赖于当前噪声块的偏移量(这些存储在两个变量中,xOffsetyOffset)?使用Math.pow(xOffset,yOffset) 之类的东西并将其设置为种子会产生不稳定、破碎的结果,这些结果根本不起作用。有人有见解吗?

任何帮助将不胜感激,谢谢!

【问题讨论】:

标签: random perlin-noise


【解决方案1】:

这是在 GLSL 着色器中实现的平铺 4D 噪波:

http://shaderfrog.com/app/view/254

它基于这个答案https://gamedev.stackexchange.com/questions/23625/how-do-you-generate-tileable-perlin-noise/23639中的实现

【讨论】:

    猜你喜欢
    • 2014-05-30
    • 2017-07-16
    • 2011-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-31
    • 2019-08-21
    相关资源
    最近更新 更多