This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Полезные советы
Программирование на C#
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm (Experimental)
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Projected Decal

A projected decal is a decal projected onto a surface by means of perspective projection. You can create an instance of the image projected onto a surface from a single point as a cone. These decals are of the same scale in spite of how far the surface they are projected onto is.

Projected decals
Notice
Changing of the projection pyramid location relatively to the projection surface changes the size of the decal in accordance with the laws of perspective.

When the human eye views a scene, objects in the distance appear smaller than objects close by - this is known as perspective.

Perspective Projection

While orthographic projection ignores this effect to allow accurate measurements, perspective definition shows distant objects as smaller to provide additional realism.

Perspective Projection Pyramid

See Also

  • The DecalProj class to manage projected decals via API
  • A set of samples located in the data/samples/decals/ directory:
    1. deferred_proj_00
    2. deferred_proj_01

Creating a Projected Decal#

To create a projected decal, perform the following:

  1. In the Menu bar, choose Create -> Decal -> Projected.

  2. Place the decal on the existing surface (for the decal to be projected, the projection pyramid should intersect the surface) and specify the required settings:

    Placement of the Projected Decal

Editing a Projected Decal#

In the Node tab of the Parameters window, you can adjust the following parameters of the projected decal:

Node tab of a projected decal

Decal Projected#

Projection parameters of the projected decal:

Radius The height of the projection pyramid along the Z axis, in units.
Field of View The field of view of the decal's projector, in degrees.
Aspect The aspect ratio of the decal, in units.
ZNear The value of the near clipping plane, ranging from 0 to 1.

Decal Common#

Parameters common for all types of decals:

Bit Masks#

Viewport Mask A viewport mask, specifying if the decal can be seen in the camera's viewport.
Intersection Mask The decal's intersection mask is used paired with the cutout intersection mask of clutters and grass to cut out the clutter or grass in the areas of intersection with the decal (e.g. can be used to remove grass from the surface of a road projected using decal).
Notice
You can specify a shadow mask and a material mask in the decal_base material.

Life-Time Parameters#

Life time A time period during which the decal is projected, in seconds.
Notice
Set -1 to make the decal permanent.
Fade time A time period during which the decal fades away (after its life time exceeds), in seconds.
Init time A time period after which the decal is projected, in seconds.

Visibility Parameters#

Parameters controlling decal's visibility depending on the distance:

Min visibility A minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible, in units.
Min 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 visibility A maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible, in units.
Max 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.

Texture Coordinates Transformation#

Decal's texture coordinates transformation (a texture atlas can also be used):

Scale X A texture size along the X axis. For example, by the scale of 2 the texture is reduced twice on one decal.
Scale Y A texture size along the Y axis.
Translate X A texture offset along the X axis. For example, by the offset of 0.5 along the X axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).
Translate Y A texture offset along the Y axis.

Setting a Material#

A material selection:

Material A new material of the decal.
Last update: 24.11.2020
Build: ()