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.
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.
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.
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.
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.
The manual material is implemented by programmers when it is necessary to create a material without using Materials Editor.
An internal material is a material without a name. When cloning or inheriting a material, each new material becomes internal until a name is assigned to it.
See Also#
- Hierarchy and Inheritance article to know more about how materials are organized.
- Materials GUIDs article to know how to refer the base and user materials.
- Materials Files section to know more about the base and user materials, the .mat and .basemat files and their connection with shader files.
- Custom Materials article to know basics of a new material creation.
- Unified Unigine Shader Language article to know how to implement a shader file for both 3D graphics APIs.
Articles in This Section
- Material Editor (Experimental)
- Material Samples
- Alpha Blend Sample
- Alpha Test Sample
- Color Sample
- Chameleon Sample
- Cubemap Texture Sample
- Curve Sample
- Custom Code Sample
- Custom Subgraphs Sample
- Displacement Sample
- Energy Shield Sample
- Fresnel Effect Sample
- Float Sample
- Loop Sample
- Make Float Sample
- Multiple Materials Blending Sample
- Object-Space Normal Map Sample
- Tangent-Space Normal Map Sample
- Parallax Occlusion Sample
- Portals Sample
- Simple PBR Material Sample
- Snow Effect Sample
- Texture 2D Sample
- Triplanar Sample
- UV Panner Sample
- UV Tiling and Offset Sample
- Vertex Color Sample
- Material Samples
- Built-in Base Materials
- billboards_base
- billboards_cloud_base
- billboards_impostor_base
- clouds_base
- decal_base
- decal_terrain_hole_base
- grass_base
- grass_impostor_base
- gui_base
- landscape_terrain_base
- landscape_terrain_detail_base
- mesh_base
- particles_base
- render_composite
- sky_base
- terrain_global_base
- volume_cloud_base
- volume_fog_base
- volume_light_base
- volume_omni_base
- volume_proj_base
- volume_shaft_base
- water_global_base
- water_mesh_base
- Postprocess Materials
- Debug Materials