SimplexNoise icon indicating copy to clipboard operation
SimplexNoise copied to clipboard

Strange disconnect in 2D in -X+Y and +X-Y quadrants

Open akastormseeker opened this issue 5 years ago • 5 comments

What steps will reproduce the problem? Generate noise using CalcPixel2D() in all four cartesian quadrants

for(x = -1000; x <= 1000; x++) { for(y = -1000; y <= 1000; y++) { map[x,y] = Noise.CalcPixel2D(x, y, 100); } }

What is the expected output? What do you see instead? Expected: smooth gradients between "hills" and "valleys" all across the map Instead: Two lines, roughly 22.5 degree and 67.5 degree angles, passing through 0,0, from -X/+Y to +X/-Y quadrants

What version of the product are you using? On what operating system? Master branch, Windows 10

Please provide any additional information below. I was experimenting with custom Minecraft procedural world generation. The base terrain level function was this: //---------------------------------- // chunks are 16x16 block sections, that go off to +/- infinity in X and Z directions, 0-255 in Y (height) direction // get offset to absolute block coordinates int offsetX = chunk.x * 16, offsetZ = chunk.z * 16; for(int x = 0; x <= 16; x++) { for(int z = 0; z <= 16; z++) { columnHeight = baseHeight + (int)(Noise.CalcPixel2D(offsetX + x, offsetZ + z, 100) * 16); for(int y = columnHeight; y >= 0; y--) { chunk.SetBlock(x, y, z, Blocks.Stone); } } } //---------------------------------- When standing at 0,0 there are two very obvious lines of discontinuity.

Screenshot

akastormseeker avatar Jun 30 '19 07:06 akastormseeker

Were you able to solve the problem?

Catdll avatar Aug 14 '20 00:08 Catdll

I think I have found the same bug/issue:

image

DoogeJ avatar Mar 13 '21 00:03 DoogeJ

Hi all - apologies for the radio silence. I'm not the original author of the noise algorithm so I have limited knowledge on how it actually works. @DoogeJ @asklar if one of you can provide a minimum example that I can run, I'm happy to take a look.

WardBenjamin avatar Mar 13 '21 01:03 WardBenjamin

@WardBenjamin Thanks for the response and taking the time to take a look!

I have made a small repository displaying the issue(s) here, with a readme explaining how to run it: https://github.com/DoogeJ/SimplexNoiseTest

DoogeJ avatar Mar 13 '21 03:03 DoogeJ

I have the same issue. @WardBenjamin has anyone figured this out privately, because I don't see any posts here?

Markinatorina avatar Sep 17 '24 10:09 Markinatorina