This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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版本。

ULON 基材文件格式

Material specifies which shaders the specific rendering pass will use to render. When you assign the material, the engine starts using its shaders to render the image.材质指定特定的着色器渲染通道将用于渲染。当您分配材质时,引擎开始使用其着色器来渲染图像。

A base material is a *.basemat text file that contains all the information to provide the final appearance for an object. The base material is created by programmers and cannot be edited via the Parameters window.基础材质是一个 *.basemat 文本文件,其中包含为对象提供最终外观的所有信息。基础材质由程序员创建,不能通过 Parameters 窗口进行编辑。

It is based on ULON file format declarations that define a base material with the given properties (options, states, textures, parameters, shaders and so on). 它基于 ULON 文件格式声明,该声明定义了具有给定属性(选项、状态、纹理、参数、着色器等)的基础材质。

Besides the ULON nodes, a base material file can also contain an inline UUSL code or UnigineScript expressions.除了 ULON 节点外,基础材质文件还可以包含内联 UUSL 代码或 UnigineScript 表达式。

The syntax is the following:语法如下:

ULON
BaseMaterial <node=ObjectMeshStatic options_hidden=0 preview_hidden=0 var_prefix=var texture_prefix=tex>
{
	/* Other ULON nodes here*/
}

There are two types of base material supported:支持两种类型的基材:

  • BaseMaterial — base material for objectsBaseMaterial — 对象的基础材质
  • BaseBrushMaterial — base material for terrain brushesBaseBrushMaterial — 地形画笔的基础材质
注意
All node names in ULON are case-sensitive.ULON 中的所有节点名称都区分大小写。

Arguments
论据#

注意
Argument names and values are case-sensitive.参数名称和值区分大小写。

editable
editable#

Boolean

A flag indicating if all of the base material settings can be changed in the Parameters window or via API.一个标志,指示是否可以在 Parameters 窗口或通过API .

Available values:可用值:

  • false — unchangeablefalse — 不可更改
  • true — changeable (by default)true — 可更改(默认)

hidden
hidden#

Boolean

A flag indicating if the material is displayed in the Materials Hierarchy.指示材质是否显示在 Materials 层次结构中的标志。

Available values:可用值:

  • false — displayed (by default)false — 显示(默认)
  • true — hiddentrue — 隐藏

manual
manual#

A flag, indicating if a material is manual: created or edited manually, not via UnigineEditor.一个标志,指示材质是否是手动的:手动创建或编辑,而不是通过 UnigineEditor。

Available values:可用值:

  • false — not manualfalse — 非手动
  • true — manual (by default)true — 手动(默认)

guid
guid#

A GUID for the base material.基础材质的 GUID。

The guid argument is optional. The GUID for the base material will be generated from its manual name in runtime, if the guid argument isn't specified. guid 参数是可选的。如果未指定guid参数,则基础材质的 GUID 将在运行时根据其手动名称生成。

options_hidden
options_hidden#

Boolean

A flag indicating if the Options section is displayed for the material in the Common tab.指示是否为 Common 选项卡中的材质显示 Options 部分的标志。

Available values:可用值:

  • false — displayed (by default)false — 显示(默认)
  • true — hiddentrue — 隐藏

preview_hidden
preview_hidden#

Boolean

A flag indicating if the material preview is displayed.指示是否显示材质预览的标志。

Available values:可用值:

  • false — displayed (by default)false — 显示(默认)
  • true — hiddentrue — 隐藏

legacy
legacy#

Boolean

A flag indicating if the legacy mode is enabled.指示是否启用旧模式的标志。

Available values:可用值:

  • false — displayed (by default)false — 显示(默认)
  • true — hiddentrue — 隐藏

var_prefix
var_prefix#

String

The prefix added to the parameters when they are passed to the shader as a variable.当参数作为变量传递给着色器时添加到参数的前缀。

texture_prefix
texture_prefix#

String

The prefixes that are added to the textures when they are passed to the shader.在将纹理传递给着色器时添加到纹理的前缀。

defines
defines#

String

The argument that specifies names of definitions that will be passed to all shaders.指定将传递给所有着色器的定义名称的参数。

node
node#

String

The type of node to which this material can be applied.可以应用此材质的节点类型。

Available values:可用值:

default
default#

Boolean

Indicates that this material is used by default for the specified type of nodes.表示该材质默认用于指定类型的节点。

Available values:可用值:

  • false — not used as the default material (by default)false — 不用作默认材质(默认情况下)
  • true — sets as the default materialtrue — 设置为默认材质

namespace
namespace#

String

The material namespace. Every manual material's name will contain this namespace: namespace::filename.

注意
The Engine has its own reserved namespaces: Unigine and Editor.The Engine has its own reserved namespaces: Unigine and Editor.
The Engine has its own reserved namespaces: Unigine and Editor.材质命名空间。每个手动材质的名称都将包含此命名空间:namespace::filename

注意
The Engine has its own reserved namespaces: Unigine and Editor.引擎有自己的保留命名空间:UnigineEditor

shader_warning_mode
shader_warning_mode#

String

The shader warning mode that defines the way warnings are treated.定义警告处理方式的着色器警告模式。

Available values:可用值:

  • disable — disables shader warnings outputdisable — 禁用着色器警告输出
  • soft — only errors result in shader compilation failuresoft — 只有错误会导致着色器编译失败
  • hard — warnings treated as errors and shader compilation fails (default)hard — 警告被视为错误并且着色器编译失败(默认)

shader_optimization_level
shader_optimization_level#

注意
Available only for DirectX API.仅适用于 DirectX API。

Available values:可用值:

  • 0 — skip optimization steps during code generation0 — 在代码生成期间跳过优化步骤
  • 1 — the compiler produces the slower code compared to other levels but does it quicker1 — 与其他级别相比,编译器生成的代码较慢,但速度更快

    注意
    Use this level for the shader debugging.使用此级别进行着色器调试。
  • 2 — the second lowest optimization2 — 次低优化
  • 3 — the second highest optimization3——第二高的优化
  • 4 — the compiler produces the best possible code but might take significantly longer to do so (default)4 — 编译器生成最好的代码,但可能需要更长的时间(默认)

    注意
    Use this level for the final builds when application performance matters.当应用程序性能很重要时,使用此级别进行最终构建。

shader_disable_error
shader_disable_error#

Boolean

A flag indicating if the shader compilation error output is disabled.指示着色器编译错误输出是否已禁用的标志。

Available values:可用值:

  • false — enables the shader compilation error output (by default)false — 启用着色器编译错误输出(默认)
  • true — disables the shader compilation error outputtrue — 禁用着色器编译错误输出

shader_disable_export
shader_disable_export#

Boolean

A flag indicating if the preprocessored shader exporting is disabled.指示预处理着色器导出是否被禁用的标志。

Available values:可用值:

  • false — enables the preprocessored shader exporting (by default)false — 启用预处理着色器导出(默认情况下)
  • true — disables the preprocessored shader exportingtrue — 禁用预处理着色器导出

shader_ieee_strictness
shader_ieee_strictness#

Boolean

A flag indicating if the floating math follows IEEE-754 specification for generated shaders.指示浮动数学是否遵循生成着色器的 IEEE-754 规范的标志。

Available values:可用值:

  • false — disables the floating math strictness (by default)false — 禁用浮动数学严格性(默认)
  • true — enables the floating math strictnesstrue — 启用浮动数学严格性

use_ui
use_ui#

Boolean

A flag indicating if the ui groups parsing is not skipped for this and inherited materials.一个标志,指示是否 ui团体对于此和继承的材质,不会跳过解析。

Available values:可用值:

  • false — skip the ui elements parsing (by default)false — 跳过 ui 元素解析(默认)
  • true — enable the ui elements parsingtrue — 启用 ui 元素解析
最新更新: 2024-08-16
Build: ()