<p>I'd consider just going with 3D noise and evaluating it on the surface of the sphere.</p>

<p>For gradient noise which is naturally in the domain of the surface of the sphere, you need a regular pattern of sample points on the surface that have natural connectivity information, with roughly equal area in each cell, so you can interpolate or sum adjacent values. I wonder if something like a <a href="http://onlinelibrary.wiley.com/doi/10.1256/qj.05.227/epdf" rel="nofollow noreferrer">Fibonacci grid</a> might work:</p>

<p><a href="https://i.sstatic.net/sQQb3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sQQb3.png" alt="Fibonacci grid on the surface of a sphere"></a></p>

<p>I haven't chewed through the math to determine how much work it would be to figure out the indices of and distance to your four neighbors (I don't even know if you end up having four well-defined neighbors in all cases), and I suspect it may be less efficient than simply using 3D noise.</p>

<p><strong>Edit:</strong> Someone else has chewed through the math! See this new paper on <a href="http://lgdv.cs.fau.de/uploads/publications/spherical_fibonacci_mapping.pdf" rel="nofollow noreferrer">Spherical Fibonacci Mapping</a>. It seems that it would be straightforward to adapt it to sphere noise.</p>

<hr>

<p>If you are rendering a sphere, not just evaluating noise on the surface of a sphere, and are fine with tessellating your sphere to the resolution of your noise lattice, you can create a <a href="https://en.wikipedia.org/wiki/Geodesic_grid" rel="nofollow noreferrer">geodesic grid</a> on the surface of the sphere (a subdivided icosahedron, usually):</p>

<p><a href="https://i.sstatic.net/pjVBA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pjVBA.png" alt="Geodesic sphere"></a></p>

<p>Each vertex of the sphere can have a randomly generated gradient for gradient noise. To get this information to the pixel shader (unless you want straightforward interpolation like value noise), you may need a technique like this article's <a href="http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/" rel="nofollow noreferrer">wireframe rendering with barycentric coordinates</a>: do unindexed rendering, with each vertex containing the barycentric coordinates of that vertex in the triangle. You can then read from <code>SV_PrimitiveID</code> (or the OpenGL equivalent) in the pixel shader, read the three noise gradients from the vertices based on what triangle you are on, and use whatever noise calculation you like using the interpolated barycentric coordinates.</p>

<p>I think the most difficult part of this method is coming up with a scheme to map your triangle ID to three samples in order to look up the noise values at each vertex.</p>

<p>If you need multiple octaves of noise or noise at a finer resolution than your sphere model, you may be able to do a coarse geodesic grid with vertices and do a few levels of subdivision in the pixel shader. i.e. from the barycentric coordinates, figure out which subdivided triangle you <em>would</em> be in if the mesh was further tessellated, and then figure out what the primitive ID and barycentric coordinates would be for that triangle.</p>

CC BY-SA 3.0
2015-08-05T21:09:35.380Z
I'd never heard of Fibonacci grids before; that's pretty cool!
Nathan Reed
CC BY-SA 3.0
2015-08-09T22:43:53.933Z
That's a fascinating paper. It looks like you can adjust the parameters to give nearer to a square grid or a hexagonal grid, which would allow different approaches to noise generation.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-05T14:56:45.127Z
2015-11-03T16:14:57.213Z
2015-11-03T16:14:57.213Z
John Calsbeek
<p>I would like to generate procedural noise on the surface of a sphere (e.g. to procedurally generate planets or marble-textured balls). Of course, I could just take a standard noise algorithm and map it onto the sphere, but this has all the issues of projecting a plane onto a sphere, like distortions on the poles or elsewhere.</p>

<p>I suppose I could generate volume noise and "cut out" the sphere, but this seems unnecessarily inefficient - and if the noise has some grid-based artefacts, these would still not appear uniformly on the sphere. Furthermore, at least in the case of Simplex noise, cutting 2D slices out of 3D noise generally looks different than generating 2D noise right away.</p>

<p>Is there any way to avoid these issues, e.g. by generating noise natively on the sphere? The noise should have at least the quality of <a href="https://en.wikipedia.org/wiki/Perlin_noise">Perlin noise</a>, ideally that of <a href="https://en.wikipedia.org/wiki/Simplex_noise">Simplex noise</a>.</p>

CC BY-SA 3.0
2015-08-05T08:37:33.923Z
Maybe triplanar projection, [as seen in GPU Gems 3](http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html)? The question is whether the noise would look blurry or otherwise undesirable when it's blending between different projections.
Nathan Reed
CC BY-SA 3.0
2015-08-11T15:02:26.827Z
I added another possible method to my post. It may be worth clarifying your question with more detailed requirements. i.e. why does a 2D slice of 3D noise not satisfy your visual requirements? What are your performance requirements?
John Calsbeek
CC BY-SA 3.0
2015-08-12T11:44:37.037Z
@JohnCalsbeek Honestly, I don't have any hard requirements at hand. This was just a question I was curious about which I thought I'd give a go for the private beta. Of course, cutting a 2D slice out of 3D noise will be sufficient for many applications, but I'm sure it will have some performance impact and anisotropies (which may or may not be noticeable). "Cutting the sphere out of 3D noise is your best option, because..." is definitely a valid answer.
Martin Ender
CC BY-SA 3.0
2015-08-17T14:58:17.797Z
You might check out this shadertoy which does noise on a sphere:
https://www.shadertoy.com/view/4sfGzS
Alan Wolfe
<projections><noise><procedural-generation>
How can I generate procedural noise on a sphere?
Martin Ender
# How can I generate procedural noise on a sphere?

(Asked by: username_0 on 2015-08-05)

I would like to generate procedural noise on the surface of a sphere (e.g. to procedurally generate planets or marble-textured balls). Of course, I could just take a standard noise algorithm and map it onto the sphere, but this has all the issues of projecting a plane onto a sphere, like distortions on the poles or elsewhere.

I suppose I could generate volume noise and "cut out" the sphere, but this seems unnecessarily inefficient - and if the noise has some grid-based artefacts, these would still not appear uniformly on the sphere. Furthermore, at least in the case of Simplex noise, cutting 2D slices out of 3D noise generally looks different than generating 2D noise right away.

Is there any way to avoid these issues, e.g. by generating noise natively on the sphere? The noise should have at least the quality of [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise), ideally that of [Simplex noise](https://en.wikipedia.org/wiki/Simplex_noise).

**Tags:** projections, noise, procedural-generation

> **Comments:**
> **username_1**: Maybe triplanar projection, [as seen in GPU Gems 3](http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html)? The question is whether the noise would look blurry or otherwise undesirable when it's blending between different projections.  
> **username_2**: I added another possible method to my post. It may be worth clarifying your question with more detailed requirements. i.e. why does a 2D slice of 3D noise not satisfy your visual requirements? What are your performance requirements?  
> **username_0**: @username_2 Honestly, I don't have any hard requirements at hand. This was just a question I was curious about which I thought I'd give a go for the private beta. Of course, cutting a 2D slice out of 3D noise will be sufficient for many applications, but I'm sure it will have some performance impact and anisotropies (which may or may not be noticeable). "Cutting the sphere out of 3D noise is your best option, because..." is definitely a valid answer.  
> **username_3**: You might check out this shadertoy which does noise on a sphere: https://www.shadertoy.com/view/4sfGzS  

---

## 1 answers

### Answer by username_2 on 2015-08-05. Score: 17 | Accepted answer

I'd consider just going with 3D noise and evaluating it on the surface of the sphere.

For gradient noise which is naturally in the domain of the surface of the sphere, you need a regular pattern of sample points on the surface that have natural connectivity information, with roughly equal area in each cell, so you can interpolate or sum adjacent values. I wonder if something like a [Fibonacci grid](http://onlinelibrary.wiley.com/doi/10.1256/qj.05.227/epdf) might work:

[![Fibonacci grid on the surface of a sphere](https://i.sstatic.net/sQQb3.png)](https://i.sstatic.net/sQQb3.png)

I haven't chewed through the math to determine how much work it would be to figure out the indices of and distance to your four neighbors (I don't even know if you end up having four well-defined neighbors in all cases), and I suspect it may be less efficient than simply using 3D noise.

**Edit:** Someone else has chewed through the math! See this new paper on [Spherical Fibonacci Mapping](http://lgdv.cs.fau.de/uploads/publications/spherical_fibonacci_mapping.pdf). It seems that it would be straightforward to adapt it to sphere noise.

---

If you are rendering a sphere, not just evaluating noise on the surface of a sphere, and are fine with tessellating your sphere to the resolution of your noise lattice, you can create a [geodesic grid](https://en.wikipedia.org/wiki/Geodesic_grid) on the surface of the sphere (a subdivided icosahedron, usually):

[![Geodesic sphere](https://i.sstatic.net/pjVBA.png)](https://i.sstatic.net/pjVBA.png)

Each vertex of the sphere can have a randomly generated gradient for gradient noise. To get this information to the pixel shader (unless you want straightforward interpolation like value noise), you may need a technique like this article's [wireframe rendering with barycentric coordinates](http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/): do unindexed rendering, with each vertex containing the barycentric coordinates of that vertex in the triangle. You can then read from `SV_PrimitiveID` (or the OpenGL equivalent) in the pixel shader, read the three noise gradients from the vertices based on what triangle you are on, and use whatever noise calculation you like using the interpolated barycentric coordinates.

I think the most difficult part of this method is coming up with a scheme to map your triangle ID to three samples in order to look up the noise values at each vertex.

If you need multiple octaves of noise or noise at a finer resolution than your sphere model, you may be able to do a coarse geodesic grid with vertices and do a few levels of subdivision in the pixel shader. i.e. from the barycentric coordinates, figure out which subdivided triangle you *would* be in if the mesh was further tessellated, and then figure out what the primitive ID and barycentric coordinates would be for that triangle.

> **Comments:**
> **username_1**: I'd never heard of Fibonacci grids before; that's pretty cool!  
> **username_4**: That's a fascinating paper. It looks like you can adjust the parameters to give nearer to a square grid or a hexagonal grid, which would allow different approaches to noise generation.  

---

