This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine 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
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
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.

Materials

A material is a set of properties (states, options, parameters) and assets (2D, 3D textures), described in a text file and associated with a particular object surface.

UNIGINE has its own material system that includes:

  • Base materials implemented by programmers.
  • User materials inherited from the base materials and adjusted via Materials Editor by 3D artists.
Notice
As UNIGINE uses its own material system, you cannot use a material provided by any third-party application.

Base Materials#

A base material stores a set of material properties and refers to fragment, vertex and geometry shaders, describing how the material will look like.

Shaders are written in GLSL and HLSL shading languages. In UNIGINE, there is also the Unified UNIGINE shader language (UUSL) that also can be used to write shaders: it allows creating a single shader file for both 3D graphics APIs: OpenGL and Direct3D11.

The base material is stored in the *.basemat file. It cannot be edited via Materials Editor: to customize the base material, you should directly edit the text file. Or you can create a brand new one.

Notice
It is possible to make the base material editable for research purposes. However, changes made to such material via the Materials Editor won't be saved to the *.basemat file.

The base materials cannot form materials hierarchy: no base material can be inherited from another base material. The base material is always on the top of the hierarchy: user materials are inherited from it.

Notice
A GUID is generated for the base material in run-time. A child *.mat file stores a GUID-based reference to the base material that it is inherited from.

A set of built-in base materials is quite big and contains most of the frequently asked materials.

User Materials#

A user material overrides properties sent to shaders used by the base material from which the user material (or its parent) is inherited. The user material itself cannot refer to a shader.

The user material is stored in the *.mat file that contains references to the parent and the base materials. Such file is usually created when inheriting a new material from the base one or the other user material via Materials Editor. The user material cannot be customized: a set of user material properties cannot differ from properties of the referred base material. However, you can edit the user material via Materials Editor.

Notice
In the *.mat file, the user material GUID is stored. The child *.mat files usually store the GUID-based reference to the parent user material.

Unlike base materials, user materials can form materials hierarchy.

Manual and Internal Materials#

In UNIGINE, there are also manual materials. Such materials are created and edited manually: changes made via Materials Editor at run-time cannot be saved. All base materials (both the built-in and the custom ones) are manual. However, not every manual material is the base one: the user materials can be manual too.

In the *.mat file, the manual user material name is stored. The child *.mat files can store name-based or GUID-based reference to the parent manual material.

Notice
Only the manual material have names (comes from the file name) and can refer to the parent manual material by a name.

The manual material is implemented by programmers when it is necessary to create a material without using Materials Editor.

An internal material is a runtime material that is not saved on a disk. When cloning or inheriting a material, each new material becomes internal until it is saved to a file.

See Also#

Articles in This Section

Last update: 2023-06-23
Build: ()