Here is another little material for an apple or should I say many apples, as the material can easily be changed to fit the kind of apple you like, as can be seen here.
You can download the material here (press the “klik her for at downloade filen” botton on the page to download it).
I start with a reference picture of the material I would like to replicate. You can easily find a apple picture by searching on google.
Apple material build-up
When we look at this picture there is a dominant color to the material which may vary a little. This is the background color and is green in this case. Ofcause apples come in many different colors which is easy to change in the final material.
The next that comes to sight is the white dots. It has a vague outer color and a sharp colored center. These will be called the big dots in this tutorial. Also, there are small dots all over the apple of similar color which give a sort of blend of color of the background.
At the top and bottom of the apple, there is not as many dots but more large areas of light and dark green. All this will be possible to make with this material.
The glossiness of the apple can change from apple to apple.
Background color: The background can be given a slight change in color with the use of a noise texture.
Big dots: The big dots can be created with a Voronoi texture. Combined with a modulator it will be possible to change the size of the dots and make sure that only certain areas are affected.
Small dots: These dot can also be created with a Voronoi texture but a modulator is not necessary as it will blend with most of the background.
Top and bottom: The mixing of colors at the top and bottom can be created with a noise texture. To only affect the top and bottom, it is necessary to get an input from the normals of the apple and only use the z-values.
Glossiness: The glossiness can be controled by a simple glossy shader and mixer.
The overall setup of the node can be seen in figure 4. I have given names to many of the nodes, which should make most of the material self-explanatory.
I will not go in to how the base color, texture of top and bottom, reflection, and bump map works, as these are relatively simple. I will give a walkthrough of the node groups small dots, big dots, and top and bottom coordinates.
The big dots consist of a modulator and two mixing controlers for the center and the background of the dots. The modulator makes sure that there is only mixing of the shaders at where the dots are.
Figure 6 shows the modulator of the big dots node groupe.
The first picture to the left in figure 7 is the pure voronoi texture where white has a value of 1 and black a value of 0. The second picture in figure 7 is the reversed values which is the first part of the modulator as seen in figure 6. We want to reverse the values, otherwise the mixing pattern node will not work as intended.
To modulate the result I use the round node to create a pattern of 1 and 0 only. This pattern will control which areas of the reversed original texture will be used by multiplying with the texture.
The circle size node is a math (add) node that increase the value to affect the round node to give different cut-off values. This can be seen in picture 4 of figure 7.
The mixing pattern node is a math (power) node which determines how much the low values will be used in the mixing. The influence of the power can be seen in figure 8 and gives the fading of the dots that can be seen in picture 5 of figure 7.
The intensity is a math (multiply) node that determines the overall mixing in the mix shader node.
For the small dots node group, only a power node is used to control the mixing as it is made for mixing with most of the background.
Top and bottom coordinates
For the top and bottom coordinates, we want the texture to only affect the part that is pointing upwards or downwards. This means the normal of the surface which have z-values close to 1 and -1 respectively. For separating the coordinates, I use the separate RGB node which gives the x, y and z values respectively. The normals coordinates will have coordinate values from -1 to 1. We can’t use -1 to plot the material to the bottom, we need the values to be 1 in the top and bottom. To reverse the values I take 0 and substracte the coordinates. If these values were to be added to the original values, it would just give 0 all over. To prevent this, the original and reversed coordinates have been striped for values below 0 with the maximum node. In this way it is possible to add the two to give values of 1 in top and bottom and values of 0 in the middle.
The power and multiply node have the same function as for the big dots node. This means if the power is 0, the entire material is covered with the top and bottom material. If the power is infinity, only the part with a normal pointing exactly upwards will have the top and bottom texture.