7
\$\begingroup\$

I'm looking to create some procedural low poly rocks and boulders for a game.

Here is an example of what I would like to achieve

I haven't found much interesting information on the internet other than 3D software articles. Not sure what way to go.

\$\endgroup\$
  • 1
    \$\begingroup\$ Like @jackmott suggested you could use a sphere. But I would also suggest using a randomized height map on the sphere. You could create a "sample" rock height map and then randomize from there. \$\endgroup\$ – Andrew Wilson Jan 29 '16 at 6:15
  • 1
    \$\begingroup\$ You definitely should check a brilliant website by procedural genius Inigo Quilez: iquilezles.org. Also see his shadertoy.com. \$\endgroup\$ – Qbic Feb 11 '16 at 14:34
  • 1
    \$\begingroup\$ Philip Rideout's par_shapes.h single-file library for parametric meshes has a rock generation algorithm based on simplex noise. You may be able to derive some inspiration from the implementation. \$\endgroup\$ – Lars Viklund Feb 11 '16 at 15:49
4
\$\begingroup\$

One approach could be to start with a sphere, perhaps pick some random parameters to stretch it varying amounts so some rocks are roughly round, while others are roughly egg shaped, then use 3D perlin or simplex noise and it's fractal variants (see the fbm methods in the link) to push vertices in towards the center, or pull them out, by some multiple of the perlin noise result. You would just pass the 3d coordinate of each vertex to the 3d perlin noise function, get back a float in the range [0,1], and use that to push or pull the vertex.

If you let me know what environment/language you are working with I can go into more detail.

\$\endgroup\$
  • \$\begingroup\$ I'm using C++ and Direct3D. I started out trying to modify a point cloud convex hull but the results are not very good. I'm going to try what has been suggested here and start from a sphere. \$\endgroup\$ – dotminic Jan 29 '16 at 16:33
  • \$\begingroup\$ I've got some handy perlin noise code in c++ here: github.com/jackmott/FastNoise-SIMD though if the spheres are low poly enough it might make more sense just to do some random displacements of verticies. Using noise would be overkill. \$\endgroup\$ – jackmott Jan 29 '16 at 16:37
3
\$\begingroup\$

When I create rocks in modelling softwares, I start from an icosaeder, fhen stretch it around, scale it a nit, then I just pick random vertices and I pull them a bit out. I suppose, the same can be made with code

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.