14

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: enter image description here

someonewithpc
  • 12,381
  • 6
  • 55
  • 89
beavoru
  • 5,357
  • 23
  • 65
  • 109

2 Answers2

22

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

enter image description here

Here is my node setup (click to enlarge):

enter image description here

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).

enter image description here

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:

enter image description here

  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:

PGmath
  • 25,106
  • 17
  • 103
  • 199
  • Amazing result! – Paul Gonet Jun 09 '15 at 11:35
  • Where's the ''less than'' option? was it from MixRGB? – beavoru Jun 09 '15 at 13:08
  • 1
    @beavoru It's a converter > math node. Sorry about that, I clarify that. – PGmath Jun 09 '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 09 '15 at 15:43
  • I am using generated coordinates, that usually works best for procedural textures. See this answer. – PGmath Jun 09 '15 at 16:12
  • 1
    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 00:11
9

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).

enter image description here

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

enter image description here

Todd McIntosh
  • 9,421
  • 25
  • 50