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:语法如下:
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 — 地形画笔的基础材质
Arguments论据#
editableeditable#
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 — 可更改(默认)
hiddenhidden#
Boolean
A flag indicating if the material is displayed in the Materials Hierarchy.指示材料是否显示在 Materials 层次结构中的标志。
Available values:可用值:
- false — displayed (by default)false — 显示(默认)
- true — hiddentrue — 隐藏
manualmanual#
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 — 手动(默认)
guidguid#
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_hiddenoptions_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_hiddenpreview_hidden#
Boolean
A flag indicating if the material preview is displayed.指示是否显示材质预览的标志。
Available values:可用值:
- false — displayed (by default)false — 显示(默认)
- true — hiddentrue — 隐藏
legacylegacy#
Boolean
A flag indicating if the legacy mode is enabled.指示是否启用旧模式的标志。
Available values:可用值:
- false — displayed (by default)false — 显示(默认)
- true — hiddentrue — 隐藏
var_prefixvar_prefix#
String
The prefix added to the parameters when they are passed to the shader as a variable.当参数作为变量传递给着色器时添加到参数的前缀。
texture_prefixtexture_prefix#
String
The prefixes that are added to the textures when they are passed to the shader.在将纹理传递给着色器时添加到纹理的前缀。
definesdefines#
String
The argument that specifies names of definitions that will be passed to all shaders.指定将传递给所有着色器的定义名称的参数。
nodenode#
String
The type of node to which this material can be applied.可以应用此材质的节点类型。
Available values:可用值:
- DecalProj — projected decal
- DecalOrtho — orthographic decal
- DecalMesh — mesh decal
- LandscapeLayerMap — landscape layer map
- ObjectDummy — Dummy object
- ObjectDynamic — dynamic object
- ObjectMeshStatic — static mesh
- ObjectMeshCluster — Mesh Cluster
- ObjectMeshClutter — Mesh Clutter
- ObjectMeshSkinned — Skinned Mesh
- ObjectMeshDynamic — Dynamic Mesh
- ObjectMeshSplineCluster — mesh spline cluster
- ObjectLandscapeTerrain — Landscape Terrain object
- ObjectTerrainGlobal — Global Terrain object
- ObjectGrass — Grass object
- ObjectParticles — particles
- ObjectBillboards — Billboards
- ObjectVolumeBox — Volume Box
- ObjectVolumeSphere — Volume Sphere
- ObjectVolumeOmni — Volume Omni object
- ObjectVolumeProj — Volume Projected object
- ObjectGui — GUI object
- ObjectGuiMesh — GUI mesh
- ObjectWaterGlobal — Global Water object
defaultdefault#
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 — 设置为默认材质
namespacenamespace#
String
The material namespace. Every manual material's name will contain this namespace: namespace::filename.
shader_warning_modeshader_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_levelshader_optimization_level#
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_errorshader_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_exportshader_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_strictnessshader_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 — 启用浮动数学严格性