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

Decal Grabber Plugin

Decal Grabber is a UnigineEditor plugin designed for automated optimization of the content at the large terrain distances. The plugin replaces the distant objects scattered across the terrain with a deferred orthographic decal that contains these objects baked into a texture. This enables to reduce the number of draw calls.

Notice
The plugin bakes all the nodes except Sky, Water, Water Mesh, Particles, Omni Light, Projected Light, and World Light.

The Decal Grabber plugin splits the terrain into the specified number of tiles and then bakes each tile into a single texture. The number of the resulting textures corresponds to the number of the tiles.

One of the terrain tiles, objects of which is replaced with the grabbed decal

Texture used for the decal

Loading Plugin

To load the Decal Grabber plugin via UnigineEditor:

  1. Run UnigineEditor.
  2. On the Menu bar, click Plugins -> Manage.
  3. In the Plugins window that opens, set the Decal Grabber plugin enabled.

    List of available plugins for UnigineEditor
  4. Close the Plugins window.

When the plugin is loaded, the additional Decals tab will appear for the ObjectTerrain node in the Nodes panel:

The Decals tab in the Nodes panel

Grabbing Decals

To grab the decal, perform the following:

  1. Select the terrain in the Nodes panel and go to the Decals tab.
  2. Set the number of tiles per terrain side (the Tiles Per Side parameter) and the size of the resulting textures into which the tiles will be baked (the Tile Resolution parameter).
  3. Set the height above the terrain, at which the decal will be grabbed (the Grab Distance parameter).
    Notice
    In isometric view, objects have the same size regardless of distance from the camera (they cannot appear closer or farther). However, the Grab Distance parameter is required as it affects LODs switching (performed by the engine) and the other visibility settings.

    The higher the distance, the fewer the number of objects and the fewer details of these objects will be visible on the grabbed decal.

  4. Set up parameters of visibility of the decal to be generated.
  5. Specify Padding and Anti-aliasing parameters to get smoother edges of the objects.
  6. Specify a path relative to the data folder where the generated textures for deferred orthographic decals will be stored.
  7. Press Grab.

In the result, the dummy node decal_lod will be added as the child node to the terrain. This dummy node will contain all the created decals. If you re-create decals, they will replace the existing ones in the nodes hierarchy.

Notice
If you grab decals when using the sRGB mode, you will have to bake the decals again for the non-sRGB mode.

The bounding box of each decal is calculated with respect to heights of the corresponding tile of the terrain.

Plugin Options

Tile Resolution Size of the resulting texture into which a single tile will be baked.
Tiles Per Side Number of tiles per terrain side. The size of the tile will be calculated relative to this value.
Grab Distance The height above the terrain, at which the decal will be grabbed. The higher the value, the fewer objects will be visible and the fewer details of the objects will be visible (depending on their LODs).
Min Visible A minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible, in units.
Fade A minimum fade-in distance, across which the decal smoothly becomes visible due to the alpha fading. It is counted starting from the minimum visibility distance value, in units.
Max Visible A maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible, in units.
Fade A maximum fade-out distance, across which the decal smoothly becomes invisible due to the alpha fading. It is counted starting from the maximum visibility distance value, in units.
Decal Material Material used for the decal. By default, the decal_deferred_base is set.
Anti-aliasing Scale factor that is used for smoothing objects baked into the decal texture. The initial size of the texture will be increased by this factor and then the texture will be downscaled to Tile Resolution.
Padding Edge padding in pixels. The specified number of additional pixels will be added in the region with the zero alpha.
Path Path (relative to the data folder) where the generated textures for decals will be stored.
Grab Grabs the decals and saves them into the textures.
Last update: 2017-07-03