This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
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
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.Decal Class

Inherits: Node

Decal class is used for base decals operation. To create, modify or get information on special types of the decals, use decal-related classes.

Decal Class

Properties

int IntersectionMask#

The current intersection mask of the decal. this mask can be used to cut out areas intersected by the decal from grass, mesh clutter and world clutter (e.g. to remove grass or forest from the surface of roads projected using decals).
Notice
The areas will be cut out only if intersection masks of grass and clutter objects matches this mask (one bit at least).
set
Sets a new intersection mask for the decal. This mask can be used to cut out areas intersected by the decal from grass, mesh clutter and world clutter (e.g. to remove grass or forest from the surface of roads projected using decals).
Notice
The areas will be cut out only if intersection masks of grass and clutter objects matches this mask (one bit at least).
set value - Integer, each bit of which is a mask.

int ViewportMask#

The current bit mask for rendering into the viewport. the decal is rendered, if its mask matches the camera viewport mask and the viewport mask of the decal's material.
set
Sets a bit mask for rendering a decal into the viewport. The decal is rendered, if its mask matches the camera viewport mask and the viewport mask of the decal's material.
set value - An integer value, each bit of which is used to set a mask.

vec4 TexCoord#

The texture coordinates for the decal (a texture atlas can be used).
  • The first pair of coordinates (x and y) set texture scale by the X and Y axes. For example, by the scale of 2 the texture is repeated twice on one decal.
  • The second pair (z and w) set texture offset along the X and Y axes. For example, by the offset of 0.5 along theX axis the texture is repositioned to the right (so that the edge of the texture is rendered in the center).
set
Sets texture coordinates for the decal (a texture atlas can be used).
  • The first pair of coordinates (x and y) set texture scale by the X and Y axes. For example, by the scale of 2 the texture is repeated twice on one decal.
  • The second pair (z and w) set texture offset along the X and Y axes. 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).
set value - Texture coordinates for the decal.

float MinVisibleDistance#

The minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible.
set
Updates a minimum visibility distance, starting at which the decal begins to fade in and then becomes completely visible.
set value - A new minimum visibility distance, in units. If a negative value is provided, 0 will be used instead.

float MinFadeDistance#

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.
set
Updates 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.
set value - A new minimum fade-in distance, in units. If a negative value is provided, 0 will be used instead.

float MaxVisibleDistance#

A maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible.
set
Updates the maximum visibility distance, starting at which the decal begins to fade out until becomes completely invisible.
set value - A maximum visibility distance, in units. If a negative value is provided, 0 will be used instead.

float MaxFadeDistance#

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.
set
Updates 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.
set value - A new minimum fade-out distance, in units. If a negative value is provided, 0 will be used instead.

float InitTime#

A time period of render initialization.
set
Sets a time period during which the decal will be projected.
set value - Time in seconds. If a negative value is provided, the decal will be permanent.

float FadeTime#

The time period during which the decal will fade away (after its life time expires).
set
Sets a time period during which the decal will fade away (after its life time expires). Fade time is ignored if the decal does not disappear.
set value - Time in seconds.

float LifeTime#

The time period during which the decal will be projected.
set
Sets a time period during which the decal will be projected. By default the decal will not disappear and setFadeTime() will be ignored.
set value - Time in seconds. If a negative value is provided, the decal will be permanent.

Members


static Decal Cast ( Node node ) #

Casts a Decal out of the Node instance.

Arguments

  • Node node - Node instance.

Return value

Decal instance.

Decal GetDecal ( ) #

Returns a decal pointer.

Return value

The decal pointer.

int SetMaterial ( string name ) #

Sets a new material for the decal.

Arguments

  • string name - Name of a new material.

Return value

1 if the material is set successfully; otherwise, 0.

int SetMaterial ( Material mat ) #

Sets a new material for the decal.

Arguments

  • Material mat - Material to be used for the decal.

Return value

1 if the material is set successfully; otherwise, 0.

int SetMaterial ( UGUID guid ) #

Sets a new material for the decal.

Arguments

  • UGUID guid - Material GUID.

Return value

1 if the material is set successfully; otherwise, 0.

Material GetMaterial ( ) #

Returns the material used for the decal.

Return value

Smart pointer to the material used for the decal.

Material GetMaterialInherit ( ) #

Inherits material for the decal (i.e. creates a material instance). Modifications made in a new material instance will not affect the source material.
Notice
A child material will be created only once, all subsequent calls to this method will return the first created child material.

Return value

Smart pointer to the inherited material.

int IsMaterialInherited ( ) #

Returns the value indicating if a given material is inherited (instanced). Modifications made in a material instance do not affect the source material.

Return value

1 if the material is inherited successfully; otherwise, 0.

string GetMaterialName ( ) #

Returns the name of a decal material.

Return value

The material name.

int IsTerrainHole ( ) #

Returns a value indicating if the decal is used to create a hole in the terrain.

Return value

1 if the decal is used to create a terrain hole; otherwise, 0.

int Inside ( vec3 p ) #

Returns a value indicating if the point with the given coordinates is inside the decal (in object-space).

Arguments

  • vec3 p - Point coordinates.

Return value

1 if the point is inside the decal; otherwise, 0.
Last update: 2019-08-16
Build: ()