Localspace

Learn about spatial data and the difference between localspace and worldspace

All data transferred between devices in World Machine falls into one of three categories:

  1. Ordinary (Non-spatial)
  2. Worldspace
  3. Localspace

Let’s take a look at the difference between these types of data.

Ordinary

Ordinary, non-spatial data in World Machine consistent of parameters and plain values. The number 0.75 or the color red don’t depend on anything else, and have intrinsic meaning on their own. They do not have a specific location in the world associated with them; they’re just a number, text, color, etc.

Easy enough.

Spatial Data

Spatial Data, on the other hand, has a unique value for each point in space, and is the principal form of data in World Machine.

Most of the spatial data in WM is defined on a grid, that contains a value at each grid point. For example: heightfields vary elevation across a plane, producing a terrain. Images contain a color for each 2D point in space in the same way.

Spatial data can exist within either worldspace or localspace.

Generally speaking, all inputs to a device must be of the same spatial type.

Worldspace

Worldspace data is the most common data you will encounter within World Machine. Unless you intentionally specify otherwise, all of your data will be in worldspace.

Worldspace data is always placed within and referenced to the current render extent.

Worldspace data contains a placement. The placement defines the geographical location of the grid data, its pixel spacing, aspect ratio, etc. This placement data is taken from the current render extent. Generator devices in World Machine will produce the appropriate results respecting that placement.

World space data exists within your defined world

This is convenient, because it means we can manipulate the render extent to change what contents are produced. If you want to move everything in your world over by a few kilometers, that is exactly the same as moving the location of your render extent by that amount.

It also means that WM always understands where and how to display your worldspace data. For example, a File Input device importing a heightfield into worldspace will place that heightfield at the particular location and size in the world as you specify.

Localspace

Localspace is actually much simpler. A localspace image or heightfield is data that has not been placed into a particular spot in the world. You can think of it as simply an “asset“, waiting to be used. Because of this, it is often referred to as an object.

A localspace texture; it does not exist within your render extent

When would you want to work in localspace? Here’s some examples:

  • Load a bitmap, tweak its colors, and export it at the same resolution
  • Create a feature such as a crater or volcano, and then populate it randomly within your world
  • Create “hero” terrain elements to be used elsewhere (perhaps as an alpha-stamp for software such as ZBrush or Mudbox)

Typically, you will create or load a localspace asset in a section of your workview graph, and then insert it into the world in some fashion. You can do this with the Instance Tile and Instance Scatter devices.

Some important things to remember about localspace:

  1. Localspace data doesn’t have an intrinsic scale to it. World Machine nominally assigns it to a patch of space 8km x 8km across, with an elevation (Z) scale the same as project elevation scale, but this is only for convenience and display purposes. The localspace data only has a real size once you place it into the world.
  2. Localspace data may have a non-square aspectio ratio. That is, the width does not have to equal the height. However, if two non-square local objects are combined (e.g. in a Combiner device, or two inputs to a filter) there is no way to specify which aspect ratio the result should use. This may be updated in the future.

Controlling Spatial Type

Most generators allow you to control the spatial type of the data that it produces. To do so, simply open the device parameters and adjust the Placement type:

The default is for a generator to inherit the placement type of the group that it resides within in the workview. This lets you set many devices to localspace at once by simply putting them inside a group set to localspace:

Localspace data flows-forward; every device after a localspace device in a chain will also be in localspace, and there will be an (L) indicator in the workview letting you know about this.

The Instance Tile/Scatter devices have an “Object Input” port that accepts a localspace input; Connect your object to this input to place it into the world.

Updated on December 8, 2021
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support

Start the discussion at forum.world-machine.com

Historical Comments

Leave a Comment