A device parameter in World Machine controls some aspect of the behavior of the device, and is normally a simple constant, like a color, selection, or number.
Spatial Parameters are an extension that allow a parameter to take on a different value across each location in the world.
Various devices in World Machine have supported this concept in the past by selectively adding input maps, such as the “Hardness” input on the Erosion device. Spatial parameters provide a uniform and powerful way of controlling these types of inputs.
Not all parameters can be spatially varied:
- At present, only floating-point parameters are eligible
- The device must specifically allow spatial variations for that parameter (marked with a “control dot” in the parameter list)
How to use
When enabled, a spatial parameter turns a single value into a range. An input port is exposed that accepts a heightfield mask. The heightmap values are then mapped to the parameter values you define.
In the image above, the Gradient’s width parameter is being spatially-varied by a radial gradient “blob” centered in the middle of the terrain. The high values in the center of the blob cause the width to take on its maximum of 28 km, while the width outside the center of the blob will be only 2.4 km.
Parameters that support spatial variance have a “control dot” next to their name in the device parameters. Clicking on the dot will expose a top parameter port that accepts a heightfield.
You can also temporarily enable/disable the spatial variance by clicking the globe icon next to the parameter name. A disabled spatial parameter takes on a constant value across the entire map, just like before.
You will find spatial parameters in many devices introduced with Artist Point!
When a device evaluates a spatial parameter, it samples the provided spatial mask-input at that location and maps it between the range you specified. Each position is evaluated separately, with no knowledge of its neighbors. This allows spatial variations to happen with minimal performance cost.
Returning to the gradient device example above, we instead connect a simple noise device, and set the “Direction” parameter to spatially vary between 50 and 68 degrees.
We expect this to cause the ridge crest of the linear gradient to wiggle slightly. And it does.. at first.
But the further you get from the device origin, the stronger the wiggles become, until it disintegrates into a chaotic pattern!
This is understandable without getting too into the mathematical weeds. You could imagine that the device is simply Choosing between two versions of the gradient, one at 50deg and one at 68deg. Far from the device origin, the two results don’t resemble each other at all. So varying between them doesn’t at all resemble what we want, even if you smoothly blended between them.
This effect only occurs when we spatially-vary a parameter defining something in XY space, such as a feature scale, width, or direction.
Because of this unintuitive behavior, only a few of these types of features allow you to spatially-vary them.
Start the discussion at forum.world-machine.com