Pandromeda Login
Tutorials
Boulder Tutorial

by Calyxa Omphalos

Introduction

Boulders and rocks are a new feature in MojoWorld 3. This tutorial shows you how to create and use them.

Making new boulders can be done by starting with any other boulder in the library, but this tutorial will start with a plain boulder object [download PlainBoulder.zip] which has no material and no displacement texture. The current version of the boulder tool does not use the material's displacement parameter to shape the boulder. All of a boulder's shaping comes solely from the boulder's surface (as opposed to material) displacement parameter. In the plans for the future is an updated boulder tool that will use both its own displacement as well as the material displacement for determining the shape. When this type of boulder becomes available, boulders will be much like planets, in that they will be able to have true overhangs!

"Installation"

Place the downloaded and unzipped PlainBoulder.mjl file into the Boulders folder inside of the Libraries folder in your MojoWorld 3 installation. The next time you launch MojoWorld, click the boulder icon and then double-click the plain boulder object in the library importer dialog to create a new plain boulder object. Drag in the RTR to place the plain boulder.

A word about Object Size

Click the boulder hot button to open the boulder editor. Expand the Transform Data control stack. The thing to note in the Transform Data is the Object Size. A boulder's internal size is always 2 meters by 2 meters by 2 meters. In the following screenshot, the plain boulder has been re-scaled in the RTR along two different sides using the scale tool. While the X, Y and Z values in the World Size parameter are all three different, the X, Y and Z values for the boulder in Object Size are all 2. The significance of this will become clear when we create the boulder's shape using a texture on the boulder's Displacement parameter.

Assign a Plain Material

Before we get into shaping the boulder, assign a plain grey material to the boulder by clicking the circle-M and then choosing 'New Material' from the material editor's menu. Close the material editor for now. With this plain grey material on the boulder, test renders of the shape textures will show much more detail.

Defining the base shape

Back in the boulder editor, click the semi-circle next to the Displacement parameter and choose 'Texture.' In the texture editor which opens, choose 'New Texture' from the menu. Change the texture's name to 'Boulder Shape'. Click the first circle-T to enable the first texture leaf. Change the texture leaf's name to 'Base Shape'. Click the leaf again to expand its kickstand. Change the Monofractal to Noise, as this texture leaf will be creating a simple underlying shape for the boulder. More complex shaping will be added with a second texture leaf later.

At the tail end of the kickstand, change the input coordinate to Object Position. The reason to define this texture in Object Position instead of World Position is so that the boulder maintains its shape regardless of where it is located in the world. The scaling of this texture will now be relative to the object's internal size, which we've seen is always a constant 2 meters for boulders. This means that the default Largest Feature Size value of 1000 on the Noise is way too large. In exactly the same way that the Largest Feature Size of a texture applied to the planet shouldn't be much larger than the planet's diameter, the Largest Feature Size of the texture used to shape the boulder shouldn't be much larger than the boulder's diameter. Set the Noise's Largest Feature Size to 1.0.

Also much like creating the mountains on the planet, the boulder's displacement needs to have its Result Scale increased. Just how much to increase it depends on the size of the boulder. We'll create a texture that'll make the Result Scale on the boulder's base shape stay proportional to the size of the boulder itself so that we don't have to worry about re-setting the parameter's value after re-sizing the boulder object.

Click the semi-circle next to the Result Scale parameter and choose 'Texture'. In the new texture editor which opens, choose 'New Texture' from the menu. Change the texture's name to 'Result Scale Amount'. Click the first texture leaf to enable it and then click it again to expand the texture leaf's kickstand. Change the texture leaf's name to 'One fifth of smallest edge' and then change the Monofractal to 'None'. Change the input coordinate to Object Size. The default parameters on the Object Size node cause it to output the length of the smallest edge of the boulder in World space. This will be a bit too large for our purposes, so open the Input Curve in the Output Controls of the texture leaf and change the Max Output from 1.0 to 0.2. The texture leaf kickstand is shown as an inset for a reminder:

The end result of this texture leaf will be to output a value that is one fifth the amount of the boulder's shortest edge - a perfect value for the Result Scale of the main boulder shape noise texture leaf. Close this texture editor.

The boulder with only the Base Shape texture leaf now looks something like this:

Defining detail shape features

In the 'Boulder Shape' texture editor, click the second circle T to create a second texture leaf. Name this leaf 'Detail Shape'. The blend between these two leaves is set to 'Maximum' by default. Change it to 'Add' for now, but after the texture for the detail shape leaf is completed, you may want to come back and try some different blends here.

The input coordinate we'll use for the detail shape texture leaf is BoundingBox Pos. This coordinate system goes from 0 to 1 across the bounding box of the object. The special feature of BoundingBox Pos which makes it very useful for the detail texturing on boulders is the De-Stretch Mode parameter, which allows the underlying basis shapes to be applied without distortions.

A De-Stretch Mode Detour

These next three images show a boulder object with no displacement and just a simple color texture. The first is with the De-Stretch Mode set to None:

Note that the squares of the texture have been stretched into rectangles, because the underlying boulder object has been stretched from its natural spherical shape into an ovoid shape.

These second two images are with the De-Stretch Mode parameter set to Longest Side and Shortest Side, respectively. The squares of the color noise texture now are truly square, no longer affected by the deformation of the underlying boulder object - the texture has been "de-stretched" so that deformations of the underlying object do not affect the scaling of the texture features.

Finish the Detail Shape texture leaf

For our Detail Shape texture leaf, besides changing the input coordinate to BoundingBox Pos, change the Largest Feature Size on the Monofractal to 0.5 and set its Result Scale parameter to a texture. In the texture editor which opens for the Result Scale, rather than defining a new texture, simply choose the previously defined 'Result Scale Amount' texture from the DDLB in the upper left corner of the texture editor. Close this texture editor for the Result Scale texture.

The boulder now has a base shape and a detail shape adding together to look something like this:

Playing with the blend

Here are four more renders of the boulder so far where the only difference is the setting of the blend between the base shape and detail shape texture leaves. The first is a minimum, then a maximum. The other two are both slope blends, the first has the default curve and the second has a tweaked curve. When the boulder shape is blended by slope, it uses the undisplaced slope of the boulder's underlying spherical surface, oriented to local up. This means that when the boulder is rotated, its shape will change!

If the boulder's shape is blended by altitude, it uses the absolute altitude at which the boulder is placed in world space, and again, this means that the boulder will change shape when moved to different altitudes in the world.

In these textures and blends, we've stayed with the default basis function of Variable Value/Gradient Perlin. A great deal of variation can be created by using different basis functions and/or using different fractal types when creating the boulder displacement shape texture.

Adding randomization capabilities with MojoGraph

Because we have not yet built in any randomization capabilities, this boulder will be the same shape even when cloned or told to randomize. To add randomization abilities, you need to have MojoWorld Pro, as the Random node is a MojoGraph feature. We'll put a Random node onto two different parameters as examples - the Largest Feature on the base shape Noise, and the Roughness on the detail shape Monofractal. Any parameter that can be driven with a function graph can have a Random node attached.

Open the 'Base Shape' texture leaf in the texture editor for the boulder's displacement parameter. Select the Noise node. Change the Largest Feature parameter to a Function (note: MojoWorld Standard users will not be able to do these steps.) In the function graph editor, there will be a single brown node for the Largest Feature parameter. Use the 'Create New Node' menu item to open the node list. Choose the Utilities category and then choose the Random Node. Click OK to create the Random Node.

The two parameters of the Random node to worry about are the Position and Variance. The Position parameter can be thought of as "the base value" and it should be set to the same value as the parameter to which the Random node is being attached. In this case, that parameter is the Largest Feature of the Noise defining the base shape of the boulder, 1.0. The Variance parameter is a maximum by which the Position parameter will be changed in each randomization. Setting the Variance to a value of 0.5 will effectively make the random range anywhere from 0.5 to 1.5.

The last parameter on the Random node, Sigma, is a drop-down list box. The choices here affect how "clustered" the randomizations are. When set to Uniform, the randomizations are evenly spread across the range defined by the Variance and Position parameters. Choices further down the menu essentially tighten up this range. Close the function graph editor.

Open the kickstand for the detail shape texture leaf and select the Monofractal node. Change the Roughness parameter to Function. Create another Random node. Set the Position parameter to 0.375, equal to the Roughness parameter before it was changed to a function. Set the Variance parameter to 0.1 which effectively limits the range of random possible values to be between 0.275 and 0.475.

Each of the Random nodes has its own Randomize punch button. Clicking the punch button here will cause that particular random node to choose a new value. When the Randomize punch button inside of the Boulder editor is clicked, then all Random nodes attached to that boulder are told to choose new values. These three renders show different randomized versions of the boulder so far:

Coloring the boulder

With the displacement texture defining the shape of the boulder, we took great pains to define that texture in terms of the boulder's space so that the boulder would not change shape when relocated. This issue also impacts the color texture, but for many color textures, it'll be far less noticeable that the boulder changes color when moved than a shape change.

For boulders with a very complex underlying texture, it's best to keep the diffuse color of the material quite simple, as a complex diffuse color texture will hide the details of the boulder's shape.

Slope-driven color textures applied to the boulder will use the slope of the boulder's surface after it has been modified by the displacement texture on the boulder. This is different from when slope is used in defining the displacement texture itself, which uses the slope of the underlying boulder sphere as oriented in world space.

If you are creating your boulder to integrate into a specific planet file, you may want to use a color texture that is also used in your planet's land material, but keep in mind the caveats above regarding the boulder's color changing as it is moved around the world. Unless you're making an animation and causing the boulder to move, though, it probably won't matter.

Randomizing colors on boulders

The easiest way to set up random colors for boulders goes right along with the suggestion that the diffuse color be kept simple. Starting with the plain grey material put onto the boulder as one of the first steps in this tutorial, click the semi-circle next to the diffuse color parameter and change it to a function. In the function graph editor which opens, create a Texture Color Control node (found in the Utilities category) and connect it to the brown Diffuse parameter node. Then create a Random Node and connect it to the Texture Color Control node. In the Texture Color Control node, the only changes to worry about are in the Gradient. Edit the gradient to include the various different solid colors you'd like your boulder to use.

In the Random Node, set the Position parameter to 0.5. This corresponds to the color at the center of the gradient. Set the Variance parameter to 0.5 as well. This allows the output of the Random Node to vary between 0.0 and 1.0, which will cover the full range of the gradient.

The completed Tutorial Boulder [download TutorialBoulder.zip] is set up with a constant, but random coloring using this method.

A collection of random boulders stamped from the completed tutorial boulder.