Procedural Rock Generator - Any ideas?

Hey guys,

I was looking for some 3D-Rock-Models for another project, but quickly found out that I need a lot of them,
so I was wondering if it’s possible to generate them procedural and export the .obj files :nerd_face:

Here is a small scratch:

The result is quite bad, probably because of my lack of skills in geometry and 3D-Graphics :sweat_smile:
So maybe some of you guys could point me in the right direction here?

How I do it:

  • Create a Sphere-Mesh with Random diameters
  • use the forceSharedVertices()-method to prevent seams (due the next step)
  • add some noise to the vertices
  • add a displacementMap which uses the “distortion.png” from our PG-assets

An other nice web-gl example which works way better then mine (still not perfect imho) can be found here:

Maybe the project is too ambitious for me…will be hard to get a variety of rocks like in these examples:

Your thoughts and help are appreciated :upside_down_face:

1 Like

Maybe that can help:

There are a number of references at the end of the doc, too.


wow this is awesome! :slightly_smiling_face:

I’m late to the party, but your issue is that you’re using a sphere. Switching it to an isosphere instantly improves it 1000%. It’s the vector shared by From there, more tweaks to the displacement map can turn this into a damn nice set of rocks.

var sphere = BABYLON.MeshBuilder.CreateIcoSphere(“sphere”,
subdivisions: 5,
radiusX: Math.random() * 1.5,
radiusY: Math.random() * 1.5,
radiusZ: Math.random() * 1.5,
}, scene);

Also, sorry for necro-posting. Procedural modeling just isn’t a common topic in Babylon yet.