# Evenly distributed point cloud for a grass renderer on a sphere

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?

• Pertubated Fibonacci sphere points? Sep 21, 2018 at 9:13
• Related (and the answer there may be relevant to a solution here): computergraphics.stackexchange.com/questions/51/… Sep 23, 2018 at 10:45
• @beyond that sounds like the beginnings of a great answer, if you could add more detail? Sep 23, 2018 at 10:49
• 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. Sep 27, 2018 at 9:56