<p>Why don't you just use Perlin noise twice on the same grid, or volume? Each with slightly different parameters (a phase shift, or different pseudo-random vectors). In this case both component of your float2 are smoothly defined by a Perlin Noise field. A float2 <span class="math-container">$v$</span> could be defined as <span class="math-container">$v = \{P(u,v), P(u+0.5, v+0.5)\},$</span> where <span class="math-container">$P(u,v)$</span> is the Perlin noise function. However, this will make the <span class="math-container">$x$</span> and <span class="math-container">$y$</span> component of <span class="math-container">$v$</span> very close depending on the scaling of the grid values.</p>

CC BY-SA 4.0
2019-02-21T13:04:47.523Z
I did wonder about that, but it seems unnecessarily computationally intensive to need to run the function twice. This is for a real-time application, so I want it to be as fast as possible ideally. But I will definitely investigate it, thanks!
kinkersnick
CC BY-SA 4.0
2019-02-21T13:08:15.960Z
Perlin noise is already a very efficient means to obtain noise. It is not uncommon to see multiple evaluations of Perlin noise per pixel for procedural textures. The performance loss will not be severe.
Reynolds
CC BY-SA 4.0
2019-02-21T13:02:58.010Z
2019-02-21T13:06:32.227Z
2019-02-21T13:06:32.227Z
Reynolds
<p>You can use the gradient of the noise/hash which for a function <span class="math-container">$f:\mathbb{R}^n\rightarrow\mathbb{R}$</span> would be <span class="math-container">$n$</span> dimensional (depending on the application this may not work for you). Another possibility, as Reynolds mentioned is to generate the noise by calling the function multiple times.</p>

CC BY-SA 4.0
2019-02-21T13:37:08.107Z
2019-02-21T13:37:08.107Z
lightxbulb
<p>I'm just getting started trying to understand noise generation algorithms. What I'm trying to achieve is to get a 2D (or 3D) grid of random directional vectors (again, 2D or 3D) according to a noise distribution like Perlin, ie. not just a grid of totally randomly generated vectors (which would be easy to do).</p>

<p>Before starting to figure this out, I had assumed that 1D noise functions would be those that produce a series of float values (ranging from -1 to 1, for example), and that 2D noise functions would produce float2 values, 3D noise would produce float3 values, and so on.</p>

<p>However, searching for so-called 2D noise functions, it seems that they are used to produce a 2D grid (ie. texture) of single float values. However, what I'm looking for is a 2D grid of 2D (float2 / vector2) values, or a 3D grid of 3D (float3 / vector3) values.</p>

<p>From my (still pretty limited) understanding of a gradient-based noise like Perlin, I feel like I could probably hack something together from an existing Perlin function - doing a bi-linear/tri-linear interpolation of the surrounding gradient vectors which are ordinarily used for the subsequent dot product in Perlin noise. But I have no idea if that's the correct approach.</p>

<p>Are there existing libraries/methods for something like this?</p>

<noise>
How to create 2D (directional) noise?
kinkersnick
# How to create 2D (directional) noise?

(Asked by: username_0 on 2019-02-21)

I'm just getting started trying to understand noise generation algorithms. What I'm trying to achieve is to get a 2D (or 3D) grid of random directional vectors (again, 2D or 3D) according to a noise distribution like Perlin, ie. not just a grid of totally randomly generated vectors (which would be easy to do).

Before starting to figure this out, I had assumed that 1D noise functions would be those that produce a series of float values (ranging from -1 to 1, for example), and that 2D noise functions would produce float2 values, 3D noise would produce float3 values, and so on.

However, searching for so-called 2D noise functions, it seems that they are used to produce a 2D grid (ie. texture) of single float values. However, what I'm looking for is a 2D grid of 2D (float2 / vector2) values, or a 3D grid of 3D (float3 / vector3) values.

From my (still pretty limited) understanding of a gradient-based noise like Perlin, I feel like I could probably hack something together from an existing Perlin function - doing a bi-linear/tri-linear interpolation of the surrounding gradient vectors which are ordinarily used for the subsequent dot product in Perlin noise. But I have no idea if that's the correct approach.

Are there existing libraries/methods for something like this?

**Tags:** noise


---

## 2 answers

### Answer by username_1 on 2019-02-21. Score: 3 | Accepted answer

Why don't you just use Perlin noise twice on the same grid, or volume? Each with slightly different parameters (a phase shift, or different pseudo-random vectors). In this case both component of your float2 are smoothly defined by a Perlin Noise field. A float2 $v$ could be defined as $v = \{P(u,v), P(u+0.5, v+0.5)\},$ where $P(u,v)$ is the Perlin noise function. However, this will make the $x$ and $y$ component of $v$ very close depending on the scaling of the grid values.

> **Comments:**
> **username_0**: I did wonder about that, but it seems unnecessarily computationally intensive to need to run the function twice. This is for a real-time application, so I want it to be as fast as possible ideally. But I will definitely investigate it, thanks!  
> **username_1**: Perlin noise is already a very efficient means to obtain noise. It is not uncommon to see multiple evaluations of Perlin noise per pixel for procedural textures. The performance loss will not be severe.  

---

### Answer by username_2 on 2019-02-21. Score: 1

You can use the gradient of the noise/hash which for a function $f:\mathbb{R}^n\rightarrow\mathbb{R}$ would be $n$ dimensional (depending on the application this may not work for you). Another possibility, as username_1 mentioned is to generate the noise by calling the function multiple times.


---

