perlin-noise

Producing 2D perlin noise with numpy

坚强是说给别人听的谎言 提交于 2021-02-07 05:19:55
问题 I'm trying to produce 2D perlin noise using numpy, but instead of something smooth I get this : my broken perlin noise, with ugly squares everywhere For sure, I'm mixing up my dimensions somewhere, probably when I combine the four gradients ... But I can't find it and my brain is melting right now. Anyone can help me pinpoint the problem ? Anyway, here is the code: %matplotlib inline import numpy as np import matplotlib.pyplot as plt def perlin(x,y,seed=0): # permutation table np.random.seed

Producing 2D perlin noise with numpy

对着背影说爱祢 提交于 2021-02-07 05:19:47
问题 I'm trying to produce 2D perlin noise using numpy, but instead of something smooth I get this : my broken perlin noise, with ugly squares everywhere For sure, I'm mixing up my dimensions somewhere, probably when I combine the four gradients ... But I can't find it and my brain is melting right now. Anyone can help me pinpoint the problem ? Anyway, here is the code: %matplotlib inline import numpy as np import matplotlib.pyplot as plt def perlin(x,y,seed=0): # permutation table np.random.seed

My Perlin Noise function having too many dark spots, and little strips of white

我是研究僧i 提交于 2021-01-28 12:26:33
问题 I created a Perlin noise function by loosely following a java tutorial in C#. I then used Unity to visualize it (I don't think the issue is with unity, as their inbuilt func works perfectly) The problem is that there are too many large dark spots. Here is a photo This is how I would like it to look As you can see, it looks as if the points are not blending well. Here is my code for the noise: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public

How is a 3d perlin noise function used to generate terrain?

自作多情 提交于 2020-02-20 06:55:49
问题 I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog, he mentioned using a 3D Perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x , y , and z values doesn't that imply you already have the height? 回答1: Well, Minecraft is about Mines. So, what Notch tried to solve was: "How do

How is a 3d perlin noise function used to generate terrain?

纵然是瞬间 提交于 2020-02-20 06:54:48
问题 I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog, he mentioned using a 3D Perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x , y , and z values doesn't that imply you already have the height? 回答1: Well, Minecraft is about Mines. So, what Notch tried to solve was: "How do

Where to start with voxel engine?

拜拜、爱过 提交于 2020-01-03 03:48:08
问题 I have been working on a voxel game for some time now, but all that I have really accomplished was the main menu and an Item system. Now its time to make the voxel engine. I have been searching for a while now to find some tutorials or an ebook that will teach me such, but the best i could find were someones tutorials in c++, but I am making mine in Java. I have dabbled in c++ and c# in the past but it was too difficult to translate i.e. it relied on a class that java doesn't have. What I

What's faster for 3D? Perlin or Simplex noise?

你。 提交于 2020-01-01 06:08:47
问题 Okay, there are a lot of comparisons between Perlin and Simplex noise to be found on the web. But I really couldn't find one where there was a simple processing time comparison between both for three dimensions, which is what I am mostly interested in. I've read that popular PDF (and even understood most of it - yay!) but I cannot answer the simple question: Which one is faster for 3D, assuming an optimal implementation? This stackoverflow question answer suggests that Simplex is a pretty

Perlin noise generator in Swift

时光怂恿深爱的人放手 提交于 2019-12-30 06:44:13
问题 I have this code for generating 1D noise in obj-c, it's working perfectly well: - (float)makeNoise1D:(int)x { x = (x >> 13) ^ x; x = (x * (x * x * (int)_seed + 19990303) + 1376312589) & RAND_MAX; return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & RAND_MAX) / 1073741824.0); } Now I'm trying to reproduce it in Swift, but it always fail and shows EXEC_BAD_INSTRUCTION on return. This is how it looks like now, I had to spit the final expression, but I'm pretty sure that's not the

Output range of Perlin noise

心已入冬 提交于 2019-12-24 11:28:11
问题 I'm investigating a few of the various implementations for coherent noise (I know there are libraries, but this is mostly for my own edification and curiosity) and how you can use it, and there's one problem I have with the original Perlin noise thing. According to this frequently linked Math FAQ, the output range will be between -1 and 1 , but I don't understand how the value gets to be in that range. As I understand it, the algorithm is basically this: each grid point has an associated

Uniform distribution from a fractal Perlin noise function in C#

孤街醉人 提交于 2019-12-12 07:48:09
问题 My Perlin noise function (which adds up 6 octaves of 3D simplex at 0.75 persistence) generates a 2D array array of double s. These numbers each come out normalized to [-1, 1], with mean at 0. I clamp them to avoid exceptions, which I think are due to floating-point accuracy issues, but I am fairly sure my scaling factor is good enough for restricting the noise output to exactly this neighborhood in the ideal case. Anyway, that's all details. The point is, here is a 256-by-256 array of noise: