Also known as: Instance Scatter, Splatter, Stamp
Scatters many copies of one or more localspace objects across the world, each with its own random position, and optionally varied size, rotation, height, and opacity. The objects can be heightfields, bitmaps, VDMs, or materials.
When to Use
Instance Scattering is one of the two fundamental ways to bring existing textures and materials into your world; the other is Instance Tiling. Use it for:
- Stamping features: Stamp rocks, dunes, craters, or plant clumps across a terrain.
- Building textures: Build up natural-looking textures from small pieces.
- Multi-scale detail: Use Fractal Layering to repeat an object at smaller and smaller scales, for dunes covered in smaller dunes or boulders surrounded by gravel.
How it works
The device divides the world into a grid of cells the size of one object (set by XY scale). Each cell may receive one copy of the object, depending on Density, and each copy is shifted randomly within its cell so the result does not look like a grid. The copies are then composited over the Background Input, or over an empty background if none is connected.
How to Use
Connect the object you want to scatter to Object Input, and your terrain or base texture to Background Input. By default every copy is identical in size, orientation, height, and opacity; the Variations controls break up the repetition.
- Create a localspace object: for example, load a rock heightfield with a File Input device, a PBR material with the Material device, or build a shape in World Machine.
- Connect it to Object Input, and its alpha mask, if it has one, to Object Mask.
- Connect your terrain or base texture to Background Input.
- Set XY scale to the real-world size of one object, and Density for how many you want.
- Raise Vary size and Vary rotation to break up the repetition.
- For heightfield objects on a terrain, choose an Operator: Add (value) to stamp the shapes onto the terrain, or Over (mask) with the terrain also connected to At Elevation to set the objects on top of it.
Inputs
| Port Name | Type | Required | Description |
|---|---|---|---|
| Background Input | Same type as the object | Optional | The content to scatter the objects onto, such as your terrain or a base texture. Must be the same type as the object |
| At Elevation | Heightfield | Optional | When connected, each object is raised to the height of this map at its location, so the objects sit on that surface instead of starting from zero. Not used for material objects: they sit on the background material’s height instead, when it has one |
| Object Input | Heightfield, Bitmap, VDM, or Material (localspace) | Required | The object to scatter |
| Object Mask | Heightfield (localspace) | Optional | The object’s alpha mask: where it is opaque and where it fades out. Without one, see When missing mask: |
| Object Variant 2 … N, Variant 2 Mask … N Mask | Heightfield, Bitmap, VDM, or Material, with mask (localspace) | Optional | Extra object and mask pairs, added by Number of Inputs. Each copy picks one of the objects at random. Unconnected variants use the first object |
Outputs
| Port Name | Type | Description |
|---|---|---|
| Result Output | Same type as the object | The background with the objects composited onto it |
| Result Mask | Heightfield (mask) | Where the scattered objects cover the world, by their opacity |
| Object ID | Heightfield (mask) | A random gray value for each copy, useful for varying color or other effects per object |
When no background is connected, the preview shows the scattered objects over a transparent background.
Parameters
Define Objects
Number of Inputs (Default: 1, Range: 1 to 16) How many different objects to scatter. Each one adds an object input and a mask input. Ports are added or removed when you release the slider.
Opacity (Default: 1, Range: 0 to 1) How strongly the scattered objects show over the background. Accepts spatial input.
XY scale (Default: 8000 m, Range: 128 m to 128 km, logarithmic slider; you can type values beyond this range) The size of each object in the world. A non-square object keeps its proportions.
Elevation scaling (Default: Proportional)
- Proportional: The objects’ heights scale along with XY scale, so smaller objects are also lower and the shape keeps its proportions.
- Specified: The height is set directly by Elevation scale, whatever the XY scale.
Affects heightfield, VDM, and material objects only; grayed out for bitmaps.
Elevation scale (Default: the full height of the world) Visible when Elevation scaling is Specified. How tall the scattered objects are, as a height in the project’s elevation range: at the default, an object’s full height spans the world’s full height range. Accepts spatial input.
Compositing
Operator (Default: Over (mask)) How each object combines with what is already there:
- Over (mask): Places the object on top of the existing content, blended by its mask.
- Under (mask): Where copies overlap, each new copy goes behind the copies already placed, showing only where they are not fully opaque. Over the background itself it behaves like Over (mask).
- Add (value): Adds the object’s values to the existing content. For heightfields this raises the terrain by the object’s shape, like stamping bumps onto it.
- Highest (value): Keeps whichever is higher, the object or the existing content.
Object mask: (Default: Unassociated) How the object’s colors relate to its mask. Unassociated is the usual case, where the object’s colors are complete even where the mask is transparent. Choose Associated (premultiplied) when the object’s colors have already been multiplied by the mask, as some image editors and renderers export them. Available only when both Object Input and Object Mask are connected.
When missing mask: (Advanced) (Default: Treat input as value (implicit mask 1.0)) For heightfield objects with no Object Mask connected, decides how to make one:
- Treat input as value (implicit mask 1.0): The object is used as is, fully opaque everywhere, so each copy shows its whole square.
- Treat input as mask (implicit value 1.0): The object is used as its own mask, with a constant value of 1. Handy when your object is a simple blob shape and you just want copies of that shape.
Grayed out when a mask is connected, or when the object is not a heightfield.
Object Z center (Default: 0) Visible when Operator is Add (value). The height in the object that counts as “ground level”. Parts of the object below it are subtracted from the background rather than added, so raising it from 0 sinks the object into the surface, digging pits around raised features. Accepts spatial input.
Variations
All variation controls default to 0 (or off), giving identical copies.
Vary opacity (Range: 0 to 1) Varies each copy’s opacity above and below Opacity. Accepts spatial input.
Vary size (Range: 0 to 1) Varies each copy’s size above and below XY scale. At 1, copies range from half to double size. Accepts spatial input.
Vary rotation (Range: 0 to 180 degrees) Rotates each copy randomly by up to this many degrees either way from Heading. 180 allows any orientation. Accepts spatial input.
Vary elevation (Range: 0 to 1) Varies each copy’s height. At 1, copies range from about a third to nearly three times their normal height. Accepts spatial input.
Vary mirroring (Default: Off) Randomly flips each copy horizontally and vertically.
Distribution
Density (Default: 0.5, Range: 0 to 1, logarithmic slider) How full the world is: the chance that each cell receives a copy. At 1 every cell gets one, so copies overlap and cover everything; low values give scattered, isolated objects. Accepts spatial input: connect a mask to place objects only in certain areas, such as on flat ground or along valley floors.
Randomization (Advanced) (Default: 1, Range: 0 to 1) How far each copy is shifted from the center of its cell. Lowering it from 1 makes the copies line up on a regular grid. Accepts spatial input.
Heading (Default: 0, Range: 0 to 360 degrees) The direction all copies face. Accepts spatial input, so you can turn objects to follow a direction map, such as dunes aligned to the wind.
Fractal Layering
Layers (Default: 1, Range: 1 to 16) How many times to repeat the scattering at finer scales. 1 is a single pass.
Lacunarity (Default: 0.5, Range: 0 to 1) How much smaller the copies get from one layer to the next. At 0.5 each layer’s copies are half the size of the previous layer’s.
Elevation Persist (Default: 1, Range: 0 to 1) How much the copies’ height shrinks from one layer to the next. At 1, smaller layers keep the same height; for natural terrain, set it around the same value as Lacunarity.
Opacity Persist (Default: 0.5, Range: 0 to 1) How much the copies’ opacity is reduced from one layer to the next. Typically around the same value as Lacunarity for terrain, but varying them independently can be very useful.
Random Seed (Advanced)
Change this for a different arrangement with the same overall look. Typed in rather than set by slider.
Placement and transform
Like other placed devices, Instance Scattering has placement settings for moving, rotating, and scaling the whole pattern.
Tips and Tricks
- Fractal Layering with 3 to 5 layers and matching Lacunarity, Elevation Persist, and Opacity Persist values turns a single shape into rich, multi-scale detail.
- Use the Object ID output with a Colorizer to tint each object differently, or the Result Mask to texture the objects separately from the background.
- Objects that are not cleanly masked show hard square edges. Give each object a mask that fades to black at its borders.
Limitations
Connect only objects of the same type as the first Object Input to the variant inputs: a variant of a different type is not scattered as itself. The background, if connected, must be the same type as the object.
Older Versions
In projects from builds before 4070, the variant inputs did not accept VDMs, so VDM objects could only be connected to the first Object Input.