World Clutter
The World Clutter node allows scattering a set of identical nodes (node references) randomly across the scene practically in one click. There is no need any longer to position, scale, and rotate every single object by hand and constantly mind the performance factor. World Clutter automatically places nodes in the scene with random parameters, all of which can be efficiently controlled, and renders them only around the camera. World Clutter is used to scatter non-geometry objects, such as decals, particles systems, and so on. But if you want to scatter identical meshes, it is better to use Mesh Clutter.
World Clutter scatters objects procedurally and therefore even more memory-efficient. At the same time it means that scattered objects cannot be moved.
See also#
- The WorldClutter class to edit World Clutter via API
Creating a World Clutter#
To create World Clutter, do the following:
-
Add a World Clutter node: in the Menu, choose Create -> Clutter -> Node.
- Locate World Clutter on the scene.
World Clutter Objects#
Objects in World Clutter are node references that are scattered throughout a definite area and for each of which the probability of its appearing is controlled.
Probability slider |
The higher the probability, the more often a node reference can be seen compared to other World Clutter objects. Let's say, we create a coast with wood chips and algae. We create wood chips decal and algae decal and save them as *.node files (create a NodeReference file). If the probability slider for algae is near to zero, the coast is thick with wood chips and only several algae are seen among them. Changing the probability of appearing does not affect the number of rendered objects, it only specifies the proportion between several World Clutter objects.
|
---|---|
Add | Add a node reference to the list of World Clutter objects. |
Remove | Delete all selected node references from the list. To select an object, a box near it should be checked. |
Reload | Reload all the node references in World Clutter. After a node reference was edited, the saved changes are not automatically applied to the same nodes scattered by World Clutter. It happens because a reference node after being loaded once is copied from the internal cache, which allows creating a lot of copies really fast. Reload option updates this cache and the changes in objects parameters come in effect. |
World Clutter Parameters#
World Clutter is rendered as a 2D grid, in each cell of which a number of World Clutter objects are randomly placed depending on the World Clutter density and probability of appearing. The cells are generated one by one starting from the nearest ones. This approach allows to control how close or far the scattered objects are from each other and at the same time reduce the rendering load when the camera moves and farther cells become visible.
Once added and scattered, the objects cannot be moved or rotated. The only way to change the scattering pattern is to change the seed.
Size X
Size Y |
The size of the World Clutter bounding box along X and Y axis. Within this area objects will be scattered with specified density. The size is measured in units. |
||
---|---|---|---|
Step for Cells |
Cell size in units. The number of cells in World Clutter is defined in the following way: size of World Clutter (both alongX and Y) is divided by the step. The higher the number of cells (i.e. the smaller the step), the higher the load. However, to create one large cell takes longer time. When the camera moves fast enough, small cells will be created very slow, but large ones can noticeably pop into sight and cause a small rendering lag. |
||
Density |
Density specifies how many objects there are per square unit. In case there is more than one object in World Clutter, probability will be taken into account, but will not change the resulting number of all rendered objects. If the density value is too high, objects can be penetrating each other.
|
||
Visibility Distance |
Across the visibility distance the number of objects is strictly specified by the density parameters. It means that all objects that should be present are found in place.
|
||
Fade Distance |
Across the fade distance the number of objects gradually decreases, as they disappear randomly one by one. Fade distance is measured starting from the Visibility Distance. If fade distance is set, there is no clear line where the objects that are contained in World Clutter abruptly disappear. Instead, a few of them will be left smoothly blend into the background without any visual noise. For the best result, it is also recommended to combine this effect with objects fade-out. |
||
Spawn Rate |
Determines how many cells (in which World Clutter is rendered) are updated each frame. Setting too high number of updated cells may lead to a performance spike. |
||
Seed | The seed value for pseudo random number generator allows to create different patterns of automatic positioning. The seed is either be set manually or an engine provides a random value for a seed (Randomize option). |
Randomizing World Clutter Objects#
To randomize the appearance of objects that compose the World Clutter, two types of values are used:
- Mean values (Scale, Offset, Rotation) define the average value. These are the basic values that will be randomly made higher or lower.
-
Spread values (Spread) define the range for possible variation of the parameter. The higher the value, the more diverse the final result will be.
The spread value is optional: if set to 0, it will not influence the simulation process and only the mean value will be used for all objects.
After these values are specified, each parameter is calculated according to the following formula:
Result = Mean + Random * Spread
where Random is a random value in range from -1 to 1. For example, if a Mean value of the parameter equals 3 and a Spread value equals 1, the final result will be any in range from 2 to 4.
Scale |
The scale mean value of scattered objects depends on the minimum and maximum scale mean values and the image mask values: the mask values are used to linearly interpolate between the minimum and maximum scale values. The mean scale value cannot be negative.
|
||||
---|---|---|---|---|---|
Offset |
Height offset parameter controls whether all objects are positioned at one height or some are found higher or lower. For example, with offset stones can be dug deep into the ground so that only a small top part is visible, or placed higher and look bigger. The offset is measured in units. |
||||
Rotation X
Rotation Y Rotation Z |
These parameters allow to randomly orient the scattered objects. The rotation is set in angles. If a spread value is set to 180, objects will be rotated by 360 degrees. |
Masking Areas with Objects#
Having objects uniformly scattered in all directions and places is naturally not very convenient. Instead of creating a number of small World Clutter nodes that cover a limited location, a big one can be used with a mask.
Image Mask |
Areas across which the objects are randomly scattered and areas without any objects from the list. For example, on the terrain, a mask allows to scatter debris across certain areas, while leaving other places free of it.
To paint the image mask directly in the scene, use Mask Editor. |
||
---|---|---|---|
Threshold for Mask |
To control the strength of masking, a mask threshold is used. It checks the masked density for an area and if a threshold value is higher than the color value of the mask, objects are scattered across it. If the masked density is not enough, the place is left bare.
|
||
Mesh Mask | A mesh-based mask can be used to place objects. Vector masking makes it possible not to depend on the mask texture resolution, and create roads, rivers, etc. with extremely high precision. A mesh for masking should be a simple planar mesh. | ||
Inverse | Toggling the flag makes the objects be placed within or outside the mesh contour. | ||
Min and Max mask values |
As a solution for advanced objects distribution and memory consumption optimization, not only a whole mask, but any required part of it can be applied to the object. It means that different objects can share the same mask, but use different levels. By default, each channel of the Image Mask specifies the areas and the density of growth in the [0;255] color density range. However, by using the minimum and the maximum value, you can specify any color density range within, and the part of the mask that contains the corresponding values will be used to scatter the nodes. Let's take the following R8 Image Mask as an example:
Several objects that represent nodes of different heights can share this mask as follows:
|
||
Flip X | Horizontal flip of the Image Mask. | ||
Flip Y | Vertical flip of the Image Mask. | ||
Cutout Intersection | Cutout bit mask. This mask is used to cut out World Clutter objects in the areas of intersection with objects and decals (e.g. to remove vegetation under houses or from the surface of roads projected using decals). World Clutter objects are cut out by objects and decals that have their Intersection masks matching this one (one bit at least). | ||
Cutout Inverse | Toggles the value that indicates whether World Clutter objects should be rendered inside or outside the areas determined by the cutout intersection mask. |
Orienting along the Relief#
Unless objects in World Clutter are scattered over a completely flat and non-tilted surface, they can be automatically positioned to precisely repeat ups and downs of the relief without any effort. For that, an underlying surface should be made a parent of the World Clutter node. (If there are some nodes in the hierarchy between a terrain or mesh node and World Clutter, intersections will still be checked.)
A parent for intersection can only be a terrain or a mesh object. The mesh should be terrain-like, i.e. it should have only one surface vertically, along the Z coordinate.
Intersection |
After the Intersection box is checked, objects in World Clutter are scattered across the surface of the parent object. It does not matter if World Clutter is bigger than the parent object in size — the scattering area will still be limited to parent object surfaces. |
||
---|---|---|---|
Orientation |
This option allows setting a parent surface normal vector as the initial orientation for scattered objects. It means if the surface in some place is vertical, the up direction for objects scattered over it will be actually pointing to the side. The objects can be still randomly rotated but relatively to the orientation of the parent normal. This parameter is enabled only if the Intersection option is enabled.
|
||
Angle |
Just like in the case with grass, scattering can take into account how steep the slope is.
This parameter is enabled only if the Intersection option is checked. |