perlin-noise

Why does switching from Mersenne twister to other PRNGs in Gradient Noise Generator give bad results?

社会主义新天地 提交于 2019-11-30 15:49:14
问题 I've been trying to create a generalized Gradient Noise generator (which doesn't use the hash method to get gradients). The code is below: class GradientNoise { std::uint64_t m_seed; std::uniform_int_distribution<std::uint8_t> distribution; const std::array<glm::vec2, 4> vector_choice = {glm::vec2(1.0, 1.0), glm::vec2(-1.0, 1.0), glm::vec2(1.0, -1.0), glm::vec2(-1.0, -1.0)}; public: GradientNoise(uint64_t seed) { m_seed = seed; distribution = std::uniform_int_distribution<std::uint8_t>(0, 3);

Why does switching from Mersenne twister to other PRNGs in Gradient Noise Generator give bad results?

别来无恙 提交于 2019-11-30 15:14:28
I've been trying to create a generalized Gradient Noise generator (which doesn't use the hash method to get gradients). The code is below: class GradientNoise { std::uint64_t m_seed; std::uniform_int_distribution<std::uint8_t> distribution; const std::array<glm::vec2, 4> vector_choice = {glm::vec2(1.0, 1.0), glm::vec2(-1.0, 1.0), glm::vec2(1.0, -1.0), glm::vec2(-1.0, -1.0)}; public: GradientNoise(uint64_t seed) { m_seed = seed; distribution = std::uniform_int_distribution<std::uint8_t>(0, 3); } // 0 -> 1 // just passes the value through, origionally was perlin noise activation double

3D Perlin noise analytical derivative

随声附和 提交于 2019-11-30 12:15:56
问题 I am currently implementing a 3D Perlin noise bump mapping using Shader Model 4 (DirectX 10 HLSL). Generating the noise itself is not a big problem (there are tons of tutorials and codes around) but what I have not found are analytical derivatives of 3D Perlin noise. The only sites taking the derivatives into account are Ińigo Quilez's site and a related GameDev.net discussion. The problem is that in the first link the noise is value based, not gradient based (which is a requirement for me),

Perlin Noise for 1D?

江枫思渺然 提交于 2019-11-30 03:27:37
问题 Try as hard as I can, I cannot find any real tutorials on Perlin\Samplex Noise in 1D. I've searched all around the internet but just cannot find anything. Any sites I do come across mentioning 1D perlin noise are usually very unclear or just shows the code 回答1: I know this is an old question but here is one of the clearest explanations about the interpolation between fixed points that makes up 1d Perlin noise http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf One of the most

3D Perlin noise analytical derivative

早过忘川 提交于 2019-11-30 02:22:50
I am currently implementing a 3D Perlin noise bump mapping using Shader Model 4 (DirectX 10 HLSL). Generating the noise itself is not a big problem (there are tons of tutorials and codes around) but what I have not found are analytical derivatives of 3D Perlin noise. The only sites taking the derivatives into account are Ińigo Quilez's site and a related GameDev.net discussion . The problem is that in the first link the noise is value based, not gradient based (which is a requirement for me), in the second link, there's only 2D gradient noise derivative. Note that I'm not looking for numerical

ampersand in code, what does it do [closed]

泪湿孤枕 提交于 2019-11-29 18:30:01
I found this code online that i'd like to understand. However, googling didn't turn up any results as to the meaning of the ampersand in the following code return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0); I got it from the following page: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm and yes, it has been pointed out that it is not real perlin, but I don't care, I want to know the basics for now. Greetings The ampersand is a bitwise AND. It means that you're comparing on the bit level. For each bit, the resulting bit is 1 if and only if the

Output range of Perlin noise

雨燕双飞 提交于 2019-11-29 10:10:26
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 random gradient vector of length 1 . Then, for each point, for all four surrounding grid points, you

Perlin Noise generation for terrain

萝らか妹 提交于 2019-11-28 15:13:46
I'm trying to implement some source code I found online to generate a height map using Perlin Noise. I've successfully managed to get the height map using the noise3 function, with the third coordinate being a random "seed", to allow for random height maps. My problem is that the terrain generated is rather dull - I want mountains and I'm getting rolling grassland. I've done some reading up on Perlin Noise (mostly here ). Due to the source code I've found obviously not written with readability in mind and my weak grasp on the concept of Perlin Noise in general, I can't figure out what I need

ampersand in code, what does it do [closed]

岁酱吖の 提交于 2019-11-28 14:26:27
问题 I found this code online that i'd like to understand. However, googling didn't turn up any results as to the meaning of the ampersand in the following code return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0); I got it from the following page: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm and yes, it has been pointed out that it is not real perlin, but I don't care, I want to know the basics for now. Greetings 回答1: The ampersand is a bitwise

Output range of Perlin noise

笑着哭i 提交于 2019-11-28 03:26:38
问题 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