Analysing a Stone Texture - The purpose of this tutorial is to show you how to break down a sample image into logical parts and build those parts in DarkTree.

This intermediate level tutorial requires a working knowledge of DarkTree.

Many of our users have asked us how to go about setting up a DarkTree from scratch.  Interpreting a, perhaps, complex texture that you would like to build can be very daunting.  ďHow do I begin? And where should I begin?Ē  These are questions youíll probably be asking .  However itís not so hard once you break it down into logical pieces.  So for this tutorial, thatís what weíll do - analyse a texture and break it into smaller, simpler steps.

For our sample texture weíll be working from this image of a stone tile. Keep in mind that the parameter values you will see written on the screen shots and the components chosen to create this DarkTree are personal choices based on trial and error - lots of it. Your best strategy is to eyeball your work repeatedly.

Letís set up the preliminaries first. Bring up a new DarkTree Editor, name your file and drag a DarkTree Shader into the root socket.  For this texture, also drag out a color Image component and get the sample image loaded (you can right click the above sample image and save it to your local disk for this tutorial). That way, you can  easily compare your efforts with the image and use the color editor to grab colors directly from it.

Looking at this stone, the bump does not seem to be that prominent.  If it was, we might begin working on the bump subtree first.  As it is, weíll start with the color subtrees. The color pattern is rather complex but can be broken down as follows:

  • gray-green areas with smoothly mottled transitions
  • lacy-edged areas concentrated in clumps and filled with a cream & pale green fragmented-looking texture
  • scattered dark brown spots and marks, plus some additional brownish areas.

From the above three patterns, weíll create three separate color subtrees, and then combine them.

The First Color Subtree

First, letís choose a noise component that can approximate the mottled gray-green areas. For this purpose, Iíve chosen a Fractal 1. To get the right colors for Fractal 1, load the sample image into the color editor and pull off the two main shades of gray-green (I chose 174, 184,176 RGB for the Low parameter and 120,138,125 RGB for High).  Youíll have to play around with the Roughness and Contrast parameters. A good rule to follow is to not make the Contrast or Roughness values too high, since it will cause aliasing problems during animation. Youíll also need to scale Fractal 1 smaller (I scaled it by 30%) and try different seeds until you get a pattern that pleases you.  The screen shot below shows the DarkTree so far with my color choices, plus the parameters I changed and their new values.

Next, we need to approximate the darker mottled areas in the image (pointed out in the following screen shot). To create the darker regions, we will use the Darken component with a Fractal 1 mask controlling where the darkened areas will be and how dark they will be.

Go ahead and place a percent Fractal 1 below the color Fractal 1 then change its seed, ensuring that both Fractal 1 patterns will be different. Be sure that the High parameter is 100% so that the lighter areas will remain unchanged. Use the Low parameter to define the maximum amount of darkening you want.  Scale Fractal 1 smaller as well; I scaled down by 30%.  Now drag out a color Darken (process) component and link its Mask parameter to percent Fractal 1 and its Background parameter to color Fractal 1.  The screen shot below shows the result.

The Second Color Subtree

This color tree is going to be a bit more complex, but letís just take it in pieces. Before creating a color subtree to fill in the lacy -edged areas, it might be a good idea to create the lacy-edged part first. We will use it to link color subtrees 1 and 2 together. So take a look at the scalloped areas in our image that enclose the greenish creamy shades. What component do you think might make a pattern with edges like that?  Different people are going to answer that question differently, but, to me, Clouds (appropriately poked and prodded of course) looks very similar.

So Iíve moved color subtree 1 to the right two sockets and plugged a color Clouds component into the socket next to the DarkTree Shader (the whole thing will have to be moved again later).  Drag out a Round generator, placing it to the right of Clouds. Change the generatorís Frequency and Phase Amount parameters (see screen shot below). Now weíll use the generator to sharpen and re -shape the cloudy edges into lacey scallops by linking Cloudsí Blend Function parameter to it. Blend Function linked in this way will remap the color gradient areas. Try playing around with these two generator parameters to better understand how they change the puff edges.

Now open the Clouds editor and increase the Contrast, then change the Seed to get a nice distribution. In order to make more of the pattern visible, I scaled it to 90%. When we link color subtrees 1 and 2 together, weíre going to link the puffs to the gray-green texture and use the areas between the puffs for our cream & pale green areas.

Now we need a component that we can use to fill in the lacey areas and give us that fragmented look. I ruminated on this a bit and finally chose a Pumice component.  After selecting two representative colors for the Pumice, I scaled the component  smaller (to 20 %) and changed some parameters (see my values below).  Next  I tested it by linking up the Cloudsí Background parameter.

 It was obvious that two colors just didnít supply enough variety. Therefore, I copy/pasted Pumice - keeping the same settings, but changing to two lighter colors. Also very important, I changed the Seed on the second one. I then linked the two Pumices through the Background parameter of the first one. If you build a DarkTree using this tutorial, you can see how much better three colors look than just two.

At this point, we need to see our progress thus far. So letís link the two color subtrees together using the lacey-edged pattern we just made with the Clouds component. Move color subtree 1 to the right a couple of sockets, and link the Puffs parameter of Clouds to it. Then link  Cloudsí Background parameter to the double-Pumice subtree (color subtree 2), if you havenít already.  In the following screen shot, the original image is visible on the upper left so that you can compare the two.  Itís getting there, donít you think?

The Third Color Subtree

The third subtree consists of one color component (very simple) and a percent mask subtree (not so simple) that defines how the color will be distributed. Looking again at the sample image, itís clear we need to add some browner areas, plus a scattering of brown spots and whatnots.

Since the mask is the most complex piece to build, letís tackle it first. The Blobs component is usually a very good one for creating random spots.  So fetch a percent Blobs, and scale it smaller (I scaled just 17%). Because Density parameter is set so low, itís actually performing part of the scaling for you. Next, adjust the parameters so that you basically have just a few small scattered spots. The screen shot below has a list of the parameters I changed. ďAs isĒ the spots wonít look very realistic because theyíre too even.  To remedy that, link a Deform component to it through its Background parameter as shown below.  This will make those spots irregular. Warp works well for this, and itís not quite so time-costly as some of the other deformers.

Plunging ahead, lets add the brown streaks and dashes - what Iíve been calling ďwhatnotsĒ. Plug a Venation component into a socket three to the right of the Shader, in the area youíve (hopefully) reserved for color subtree 3. This component is a good starting choice for scattered lines and marks. Scale Venation smaller (mine is at 30%) and adjust its parameters to get a good distribution.  Itís important to break up the straight lines of Venation by linking its Veins parameter to a Noise.  I again used Fractal 1 for the noise. After linking the two components, eyeball the vein distribution and scale Fractal 1 smaller until it looks right to you. I scaled to 10% and then an additional 68%. Finally, I used Venationís Background parameter to link to Warp. ( You may have to move your Warp/Blobs set to the right a socket or two first.)

If you take another look at the sample image, itís pretty clear that the lighter areas have a distinct brownish caste in some places.  To make our DarkTree match, we need to address this. (Remember, weíre actually adding the brown color to this whole subtree last, even though weíre discussing it now.)

We could build up some browner lacy areas in the same way we did the lighter-colored ones, but letís try something different.  Skyler actually put me on to this. Weíre going to add a hazy effect to the mask weíve been working on, and then color it brown. Itís effective and simplifies the DarkTree too.  So, again I chose good old Fractal 1 for the hazy effect. Change the Fractal 1 parameters and scale smaller (I scaled about 10% here).  Notice that I reduced Fractal 1ís High parameter specifically to get the hazy effect.  Finally, letís add our mask pieces together with a percent Add component. Use Addís Percent A parameter to link to Venation (the blobs and whatnots section) and Percent B to link to Fractal 1 (the hazy stuff).

To pull all three subtrees together, Iím using a Composite component.  So plug in a color Composite just to the right of the DarkTree Shader and a color Rough noise component directly to the right of Composite. The Rough component will supply the color for the mask goodies (blobs, whatnots and haze). Edit the Rough for color.  I used 90.64, 73.83, 57 RGB for the Low parameter and 125.5, 88.5, 51.5 RGB for the High parameter.

With this done letís put all of the color parts together! Hereís how to link up the Composite parameters! Link the Color A parameter to color subtrees 1 and 2 via  Clouds, the Mask parameter to the percent tree weíve just been working on and the Percent B parameter (which colors the mask)  to the Rough component. Youíll probably want to adjust the brown and perhaps strengthen the green background as well, since it now has to vie with the haze. Lastly link Composite to the Shader component via the color channel.
Simply to finish off the texture more completely for this tutorial, Iíve added a small bump subtree and a reflectivity subtree as well.  Since we are looking at a sliced and polished stone tile, any bump areas would naturally be indented.  So I have chosen to simply add a small amount of bump to the whatnots. This consists solely of  linking a bump Mask Gradient component to the Venation  subtree that we already have.  The link is the Mask parameter, as shown below.

Now lets make a small modification to the DarkTree Shader so the surface will look shiny.  Change the shading values: Specular Level = 40% and Glossiness = 100%.

And finally, I added a reflectivity subtree to finish the shader with a bit of polish. Itís really just a single percent Incident component. Iíve made the effect quite subtle; so donít expect it to show up in an Examine window. To give some reflection near the edges, I gave the Edge parameter a fairly low value (to keep it subtle); the Facing parameter got almost none. When this texture is applied to an object with rounded edges of some sort, then the effect will be visible.


Here is a comparison between the final DarkTree (below left) and the sample image (below right). In evaluating how successful it is, I guess I would ask the question, ďDoes this texture look like it could have come from another section of the same material?Ē I say, ďYes! Indeed it could.Ē

Here is an example of the new shader rendered in Cinema 4D.

For those of you who have stuck with the entire tutorial, how could I have improved my presentation? And what was most useful to you?
Grimalkin email:

Copyright © 2006 Darkling Simulations, LLC. All rights reserved.         Any questions? Mail me!