<p>I'm trying to add some details like grass, rocks, trees, etc. to my little procedurally-generated planet. The meshes for the terrain are created from a spherified cube which is split in chunks (chunked LOD).</p>

<p>To do this I've wrote a geometry shader that takes a mesh as input and uses its vertex positions as locations where the patches of grass will be placed (as textured quads).</p>

<p>For an infinite flat world (not spherical) I'd use the terrain mesh as input to the geometry shader, but I've found that this won't work well on a sphere, since the vertex density is not homogeneous across the surface.</p>

<p>So the main question would be: How to create a point cloud for each terrain chunk whose points were equally distributed across the chunk? </p>

<p>Note: I've seen some examples where these points are calculated from intersecting a massive rain of totally random perpendicular rays from above... but I found this solution overkill, to say the least.</p>

<p>Another related question would be: Is there something better/faster than the geometry shader approach, maybe using compute shaders and instancing?</p>

CC BY-SA 4.0
2018-09-21T09:13:03.090Z
Pertubated Fibonacci sphere points?
beyond
CC BY-SA 4.0
2018-09-23T10:45:55.020Z
Related (and the answer there may be relevant to a solution here): https://computergraphics.stackexchange.com/questions/51/how-can-i-generate-procedural-noise-on-a-sphere
trichoplax is on Codidact now
CC BY-SA 4.0
2018-09-23T10:49:19.603Z
@beyond that sounds like the beginnings of a great answer, if you could add more detail?
trichoplax is on Codidact now
CC BY-SA 4.0
2018-09-27T09:56:58.433Z
You should be able to find the code for creating a Fibonacci sphere. These points are somewhat evenly distributed over the sphere. In order to make it look more real-life like you could pertubate the points randomly on the surface. This way you could make your grass sphere.
beyond
<shader><gpu><procedural-generation>
Evenly distributed point cloud for a grass renderer on a sphere
Trap
# Evenly distributed point cloud for a grass renderer on a sphere

(Asked by: username_0 on 2018-09-20)

I'm trying to add some details like grass, rocks, trees, etc. to my little procedurally-generated planet. The meshes for the terrain are created from a spherified cube which is split in chunks (chunked LOD).

To do this I've wrote a geometry shader that takes a mesh as input and uses its vertex positions as locations where the patches of grass will be placed (as textured quads).

For an infinite flat world (not spherical) I'd use the terrain mesh as input to the geometry shader, but I've found that this won't work well on a sphere, since the vertex density is not homogeneous across the surface.

So the main question would be: How to create a point cloud for each terrain chunk whose points were equally distributed across the chunk?

Note: I've seen some examples where these points are calculated from intersecting a massive rain of totally random perpendicular rays from above... but I found this solution overkill, to say the least.

Another related question would be: Is there something better/faster than the geometry shader approach, maybe using compute shaders and instancing?

**Tags:** shader, gpu, procedural-generation

> **Comments:**
> **username_1**: Pertubated Fibonacci sphere points?  
> **username_2**: Related (and the answer there may be relevant to a solution here): https://computergraphics.stackexchange.com/questions/51/how-can-i-generate-procedural-noise-on-a-sphere  
> **username_2**: @username_1 that sounds like the beginnings of a great answer, if you could add more detail?  
> **username_1**: You should be able to find the code for creating a Fibonacci sphere. These points are somewhat evenly distributed over the sphere. In order to make it look more real-life like you could pertubate the points randomly on the surface. This way you could make your grass sphere.  

---

## 0 answers

