Tutorial #1. Surface Replicators

I love Carrara’s surface replicators. If you hadn’t noticed yet I use them extensively in all my scenes to place vegetation over the landscape. The replicators are a memory efficient way to add a huge number of copies (or instances) of an object to your scene. Surface replicators will place those instances across the surface of another (or source) object whereas regular replicators will place the instances into rows or grids.


Introduction

Replicators were introduced to Carrara in version 5 so this tutorial is relevant to all versions of Carrara Standard or Pro since version 5 (although the download resources require Carrara 6 or above).

In this tutorial I’ll demonstrate how to scatter autumn leaves below a tree using Carrara’s surface replicator. We will work towards creating the following image.


Step 1. Setting Up

To get started you can download and un-zip the tutorial resources. Open the file “hf_tutorial001_initial.car” with Carrara and you should see the scene below.

The scene contains a solitary tree on an infinite plane and a single leaf that shall be the replicated object. Carrara’s surface replicator will create instances of this leaf object over the surface of a source object. We can not use the infinite plane as the source object so let’s add a standard plane to the scene. Select “Insert -> Plane” from the menu.

Rename this object to “Leaf Plane”.

We want the Leaf Plane to sit just above the infinite plane so set the “Z” value of the “Leaf Plane” hot point to “0.001″ and set the overall scale to “135″.

Now let’s add the surface replicator object. Select “Insert -> Surface Replicator” from the menu.

Rename the replicator to “Leaf Replicator”.


Step 2. Configure the Replicator

Set the display method to “Points” and set the source object to “Leaf Plane”.

The display method controls how the replicated instances are displayed in the assemble room. It has no impact on the final render but setting it to “Points” has the benefit of being the least resource hungry display method so will slow down the assemble room 3D view the least.

Populate the replicator by dragging the “Leaf” object onto “Leaf Replicator” in the instances tab.

You should now see about 100 points scattered randomly across “Leaf Plane”.

100 leaves under the tree is really too small a number so let’s increase the instance count. Double-click on “Leaf Replicator” to access its properties. Drag the “Number of Objects” slider to about somewhere near 10,000 – a bug Carrara 7.1 stops you from directly typing in a number larger than 100 so you’ll have to use the slider here if using Carrara 7.1.

Carrara tells us that “Only 482 objects could be placed on the surface” even though we specified 9938. To remedy this the minimum distance between objects needs to be adjusted. To realistically depict fallen leaves it is okay to have the leaves almost piled up upon each other, therefore there is no requirement to set a minimum distance so set this parameter to “0″.

Other parameters to adjust are scale and rotation. Set the “Z” roation to “360″. This will randomly rotate each instance on the Z axis to any angle between 0 and 360 degrees. Set the scale to” -33″. This will result in each instance being somewhere between its original size or 33% smaller.

It’s important to remember that the minimum distance between objects actually refers only to the hot points of the objects. Therefore, should you not want any objects’ geometry to overlap you need to set the minimum distance to something greater than the actual size of the object.

Lets go back to the assemble room and see what we’ve got.

The replicator has evenly distributed the instances over the entire plane, what we really want is to have the leaves more densely spaced around the tree trunk and becoming less dense towards the outer perimeter of the tree’s crown. We also don’t want the square shape of the “Leaf Plane” to be evident. Fortunately Carrara’s surface replicator can use a shader to drive the distribution of instances.


Step 3. Using a Distribution Shader

Included in the tutorial resources shall be the following image (leaf_distribution.jpg).

This image represents the density of the leaf instances we require. White areas of the image represent maximum density while gray areas are less dense and black represents zero density. This image was simply created in Photoshop using a white airbrush on a black background. Now let’s apply this image to the replicator’s distribution map.

Double-click on “Leaf Replicator” in the instances tab to return to the replicator’s edit window. Check the “Use Shader” checkbox, then click on “Edit Shader” button to edit the distribution shader in the shader room.

Now in the shader room, set the “Top Shader” to “Projection Mapping -> Flat Mapping”

Set the projection direction to “Top” by selecting the icon circled in the image below.

Now set the shader to “Texture Map” and load in “leaf_distribution.jpg”. You shader should look like this.

You might need to return to the replicator’s edit page and press the “Distribute” button to apply the shader to the distribution of the leaves.

Return to the assemble room to view the changes.

The instances are clustered in a roughly circular area around the tree but we’re not getting quite as much density fall-off as was wanted. While a distribution shader can contain any of Carrara’s shader effects the replicator is not very sensitive to using grays as lower density areas and will fill them up almost as much as pure white areas. Fortunately there is a simple solution that can be applied using almost any image editing application.

Using your image editor down sample “leaf_distribution.jpg” from an 8bit gray scale image to a 2bit black and white image. Make sure to use a diffusion dither. The image below is the result we’re after.

Save this image and re-load it in the distribution shader, redistribute the instances and you should have the following view in the assemble room.


Step 4. Finishing up

We’ve now got a nice distribution of leaves, dense near the tree and falling away the further we get from the trunk. There’s just one more thing to take care of before rendering. The “Leaf Plane” is still visible but we don’t actually want to see it so turn off its visibility.

The leaf instances will still be visible but the square plane that they are distributed across will no longer render.

Go to the render room, press render and behold the fruits of your labors.

That concludes this tutorial. I have demonstrated how to add a surface replicator to a scene, add objects to the replicator and configure their distribution. And lastly, how to further control the distribution of the objects using a shader. If you feel that anything is unclear or missing please don’t hesitate to leave a comment below and I’ll see what I can do to fix it.

Cheers,

Martin (HowieFarkes)

12 Responses to “Tutorial #1. Surface Replicators”

  1. Dan Veith says:

    Thank you Martin for such a clear and concise tutorial. I purchased your “Secret Lake” scene and learned a lot about your excellent landscape methods from that, but the 2-bit dithering is something new and I will surely try it. Thanks for sharing your knowledge!

  2. kyraneth says:

    Thank you so much, very useful tut!

  3. Brilliant mate.
    Thanks

    Brian

  4. Wow. The dithered map is an eye opener… Thanks for this!

  5. Locke2121 says:

    Howie you is my he-ro! I’m moving more and more into Carrara because of its powerful capabilites..but the SR has always confused me a bit. Now I get it! Thanks!

  6. Roygee says:

    Thank you so much for this most elegant explanation – much appreciated

  7. Ian Bennett says:

    A very well laid out and clear tutorial that opened my eyes to yet more functions hidden within Carrara.
    Brilliant… I look forward to seeing more tutorials of this standard appear.
    Thankyou for sharing your knowledge.

  8. YourSunshineGirl says:

    Cool, tut. Thank you so much!

  9. PhilW says:

    Brilliant tutorial! Succinct and clear, and the tip about 2-bit dithering solves an issue with distribution densities. I have already learned a lot by studying your scenes!

  10. Jeanne says:

    Thank you so much for this tutorial. :)
    Love, Jeanne

  11. This is such a great tip.
    Very clever.

    Thanks for sharing!

  12. Reggie says:

    Very well done. I’m always in the Daz forums and rarely respond to anything but you’re tutorial was good. Thanks for the tutorial!