# How to make a 'rocky' material with procedural bump?

If I have a modeled rock and I want to somehow to add details to it like the ones from an Asteroid (like, little holes) which kind of Node setup should I need?

My actual node setup (it's on cycles) is pretty simple, it's just a regular Diffuse color and with the Output, due to the figure itself, it reacts well to lighting. But I do want little details that can also react to light (like a bump, but random).

Reference:

• Sorry, I think I misread the question (or it was edited while I was answering!) Are you looking for a procedurally generated bump texture? – Todd McIntosh Jun 8 '15 at 21:00
• Hmm, something like that, some 'random' pattern along the rock, without the need of a texture. (or also UVs) – beavoru Jun 8 '15 at 21:02
• Ok, so you do want a procedural texture then. Are you using it for surface colour or for bump or displacement effects? – Todd McIntosh Jun 8 '15 at 21:04
• – gandalf3 Jun 8 '15 at 22:21
• you could just do it with geometry... – Scalia Jun 8 '15 at 22:25

I was able to get something pretty close to what I think you are looking for using a voronoi texture.

Here is my node setup (click to enlarge):

Here is a close up of the nodes that make the holes (there are actually two of these sets, one for the larger holes and one for the smaller ones).

The upper voronoi texture, set to cells, is sent through a less than node to "weed out" a few cells I then use that result to mask the lower voronoi, set to intensity. If that didn't make any sense here is an image that will hopefully clarify it:

1. Cells voronoi texture.
2. Put through less than 0.4 node (converter > math) to "grab" 40% of the cells.
3. Used to mask intensity voronoi texture.
4. Color ramp node added to (mostly) eliminate the hexagons. (Try playing with the color ramp swatches to see how this works.)

The main material is simply two of these setups with a noise texture for added roughness, all put into the bump of a grey diffuse shader. The asteroid itself is simply an icosphere with a subsurf and two different sized displacement modifiers.

Here's the .blend:

• Amazing result! – Paul Gonet Jun 9 '15 at 11:35
• Where's the ''less than'' option? was it from MixRGB? – beavoru Jun 9 '15 at 13:08
• @beavoru It's a converter > math node. Sorry about that, I clarify that. – PGmath Jun 9 '15 at 14:07
• Wait, a last question, what kind of UV does the object has to have in order to work with this? my object shows the 'dots' as boxes – beavoru Jun 9 '15 at 15:43
• Woo hoo! I can comment now! This answer is actually what inspired me to accumulate 50 rep points so I could make the comment "This is such a great answer!" I especially appreciate that you provided the blend file. Being able to to explore the nodes and tinker with them was very educational, not only to learn the nuts and bolts of how it works, but also to gain insight into your creative problem solving process. Very creative indeed. Nice work! – YoeyYutch Jul 14 '15 at 0:11

You can use a greyscale version of the image texture to create either:

• a Bump Map or
• Mesh Displacement via the Displacement Modifier.

The Bump solution is the lighter, less resource-intensive solution, and it will be easier to render. However it will give you the illusion of craters on the surface, and will not affect the silhouette of the object.

The Displacement modifier solution will give you actual changes to the surface of the mesh and WILL affect the sillhouette of the object. However you will have to subdivide the mesh (or apply a SubDiv modifier) many times to get a good clean result, and this will make the mesh difficult to work with. Another challenge of this technique is that it works better with higher bit depth images. Higher bit images (16bit, 32bit) have a wider variance between dark and light values, giving more variance in the range of the displacement effect. For most scenarios, however, you'll likely be working with 8bit images which doesn't provide a huge range in displacement values.

In reality, you'll probably always want to set up the Bump Map. It will give the fine details you need. The Displacement mod is really only helpful for larger features on the profile of mesh. You can always use both together if need be.

Here's a screenshot with an asteroid with Bump Map only (on Left).

Here's a screenshot with the asteroid with Displacement only (on Right)

• I think he wants a procedural solution. – PGmath Jun 8 '15 at 23:29
• Yep, I think so too. – Todd McIntosh Jun 9 '15 at 0:08