This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Field Spacer

A spacer field is an object, specifying geometry areas of grass and water that should not be rendered. Inside the spacer field, geometry is cut off gradually starting from the center of the field.

The spacer field allows you to dynamically adapt grass and water surface to other objects in the scene. For example:

  • A field spacer can be used to specify area under a building and around it where grass should not grow. Moreover, by using the attenuation factor, it is possible to create thinner grass around the building.
  • A field spacer can be set for a boat so that water is not rendered inside it.
Notice
A spacer field will affect grass or water only if the Spacer interaction flag is set on the States tab of the corresponding material.
Boat without the spacer field: water is inside the boat
Boat with the spacer field: the spacer field cuts water off

See also

  • A FieldSpacer class to edit spacer fields by using UnigineScript
  • A Unigine::FieldSpacer class to edit spacer fields by using C++ API
  • A set of samples located in the data/samples/fields/ folder:
    • spacer_00
    • spacer_01
    • spacer_02

Adding Field Spacer

To add a spacer field in the world via UnigineEditor, do the following:

  1. On the Menu bar, choose Create -> Effect -> Field Spacer.

  2. Place the spacer field in the world so that it intersects geometry required to be cut off:
    Notice
    Make sure that the Spacer interaction flag is set for materials applied to grass or water.
    • In case of grass, the spacer field should intersect the surface, on which grass grows.
    • In case of water, the spacer field should be submerged into water on the required depth. For example, the following pictures demonstrate the same spacer field submerged on different depth:

If you are going to use the spacer field with dynamic objects, it is better to add the field as a child node to this object so that it can correctly affect grass or water geometry.

Editing Field Spacer

On the Field tab of the Nodes panel, the following parameters of the spacer field can be adjusted:

Setting Form of Spacer

Ellipse Indicates whether the spacer field is ellipsoid-shaped. If unchecked, the spacer field has a form of a cube.

Setting Bit Masks

Field A field mask. A bit mask that specifies an area of the spacer field to be applied to grass or water. The spacer field will be applied to grass or water only if they have matching masks.
Viewport A viewport mask. A bit mask for rendering the spacer field into the current viewport. For the spacer field to be rendered into the viewport, its mask should match the camera viewport mask.

Setting Size and Attenuation

Size Size of the spacer field along the axes in units.
  • If the Ellipse option is unchecked, this is the size of the spacer field box along the axes.
  • If the Ellipse option is checked, these are the ellipse radius values along the axes.
Atten An attenuation factor indicating how much geometry is cut off gradually starting from the center of the spacer field.
  • By the minimum value of 0, all geometry inside the field spacer will be rendered.
  • The higher the value, the less geometry will be rendered inside the spacer field.
Atten = 5
Atten = 15
Last update: 03.07.2017
Build: ()