This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
VR Development
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

材质

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.材质是一组属性(状态,选项,参数)和资源(2D,3D纹理),在文本文件中描述并与特定的对象表面相关联。

UNIGINE has its own material system that includes:UNIGINE拥有自己的材质系统,包括:

  • Base materials implemented by programmers.程序员实施的基础(base)材质。
  • User materials inherited from the base materials and adjusted via Materials Editor by 3D artists.从基础材质继承的用户(user)材质,并由3D艺术家通过“材质编辑器”进行了调整。
注意
As UNIGINE uses its own material system, you cannot use a material provided by any third-party application.由于UNIGINE使用自己的材质系统,因此您不能使用任何第三方应用程序提供的材质。

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.着色程序以GLSL和HLSL着色语言编写。在UNIGINE中,还有统一UNIGINE着色程序语言(UUSL)也可用于编写着色程序:它允许为两个3D图形API(OpenGL和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.基础材质存储在*.basemat文件中。不能通过材质编辑器对其进行编辑:要自定义基础材质,您应直接编辑文本文件。或者,您可以创建一个全新的

注意
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.出于研究目的,可以使基础材质可编辑。但是,通过“材质编辑器”对此类材质所做的更改不会保存到*.basemat文件中。

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 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.在运行时为基础材质生成一个GUID*.mat文件存储基于GUID的对基材质的引用,它是从基材质继承的。

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.用户材质存储在*.mat文件中,该文件包含对父级和基础材质的引用。通常,当通过“材质编辑器”从基础材质或其他用户材质继承新材质时,会创建此类文件。用户材质无法自定义:一组用户材质属性不能与引用的基础材质的属性不同。但是,您可以通过“材质编辑器”编辑用户材质。

注意
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.用户材质GUID存储在*.mat文件中。子*.mat文件通常存储基于GUID的对父用户材质的引用。

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.在UNIGINE中,还有手动材质。此类材质是手动创建和编辑的:在运行时通过材质编辑器进行的更改无法保存。所有基础材质(内置材质和自定义材质)都是手动的。但是,并非每种手动材质都是基础材质:用户材质也可以是手动创建的。

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.*.mat文件中,存储了手动用户材质名称。子*.mat文件可以存储基于基于名称或基于GUID的对父手动材质的引用。

注意
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也可以看看#

本節中的文章

最新更新: 2023-12-19
Build: ()