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
材质和着色器
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

参数

The material parameter that is available in the shader as a variable. Use the type of the ULON node for the parameter type.在着色器中作为变量可用的材质参数。使用 ULON 节点的类型作为参数类型。

The syntax is the following:语法如下:

ULON
ParameterType name = value <attributes>

The parameters are passed to shaders with the specified variable prefix.参数通过指定变量传递给着色器字首.

Types of Parameters参数类型#

  • float / float2 / float3 / float4 — a float vector of N components in UUSLfloat / float2 / float3 / float4UUSLN 分量的浮点向量
  • Int / Int2 / Int3 / Int4 — an integer (int) vector of N components in UUSLInt / Int2 / Int3 / Int4UUSLN 分量的整数 (int) 向量
  • ArrayFloat / ArrayFloat2 / ArrayFloat4 — an array of float vectors with N components in UUSLArrayFloat / ArrayFloat2 / ArrayFloat4:在 UUSL 中具有 N 分量的浮点向量数组
  • ArrayInt / ArrayInt2 / ArrayInt4 — an array of integer (int) vectors with N components in UUSLArrayInt / ArrayInt2 / ArrayInt4:在 UUSL 中具有 N 分量的整数 (int) 向量数组
  • Color — a float vector with 4 components representing a color in UUSLColor:具有 4 分量的浮点向量表示 UUSL 中的颜色
  • Mask24 / Mask32 — an integer representing the mask in UUSLMask24 / Mask32:表示 UUSL 中掩码的整数
  • UV — a float vector of 4 components representing a UV transformation UV:表示 UV 变换的 4 分量的浮点向量
  • Slider — a float variable with the default range of [0, 1]滑块:默认范围为 [0, 1] 的浮点变量
ULON What to use for initialization in ULON? UUSL
Float float value浮点值 float
Float2 array of 2 float values2 个浮点值的数组 float2
Float3 array of 3 float values3 个浮点值的数组 float3
Float4 array of 4 float values4 个浮点值的数组 float4
ArrayFloat float value浮点值 float[N]
ArrayFloat2 array of arrays of 2 float values2 个浮点值组成的数组 float2[N]
ArrayFloat4 array of arrays of 4 float values4 个浮点值组成的数组 float4[N]
Color array of 4 float values4 个浮点值的数组 float4
UV array of 4 float values4 个浮点值的数组 float4

Usage Examples使用示例#

For instance, the following example parameters are defined using the expression:例如,以下示例参数是使用表达式定义的:

ULON
Float float_example = 1  
Int int_example = 1
ArrayFloat array_example = [1 2 3 4 5] <size=5>
ArrayFloat2 array_float2_example = [1 2 3 4 5 6] <size=3>
Float4 float4_example = [1 2 3 4]
Color color_example = [1 1 1 1]
UV uv_example = [1 1 0 0]
Mask24 mask24_example = 1

They are accessible in the shaders with the specified prefix:它们可以在具有指定前缀的着色器中访问:

UUSL
float a = var_float_example;
int b = var_int_example;
float c = var_array_example[0];
float d = array_float2_example [0][1];
float4 e = var_float4_example;
float4 f = var_color_example;
float4 g = var_uv_example;
int h = var_mask24_example;

ArgumentsArguments#

namename#

String

The name of the parameter.参数的名称。

shader_nameshader_name#

String

Uniform name in the shader. If specified the provided uniform name is used, otherwise default naming logic is used.着色器中的统一名称。如果指定,则使用提供的统一名称,否则默认命名逻辑用来。

minmin#

Float

The minimum limit for a parameter range (not applicable for Color and Array types).参数范围的最小限制(不适用于 ColorArray 类型)。

Default values:默认值:

  • 0.0 — for the Slider parameter0.0:用于 Slider 参数
  • -inf — for all the others parameters-inf:对于所有其他参数

maxmax#

Float

The maximum limit for a parameter range (not applicable for Color and Array types).参数范围的最大限制(不适用于 ColorArray 类型)。

Default values:默认值:

  • 1.0 — for the Slider parameter1.0:用于 Slider 参数
  • +inf — for all the others parameters+inf:对于所有其他参数

titletitle#

String

The parameter group title that will be displayed in the Editor.将在编辑器中显示的参数组标题。

tooltiptooltip#

String

The tooltip text displayed in the Editor on cursor hover over the parameter field.光标悬停在参数字段上时,编辑器中显示的工具提示文本。

widgetwidget#

String

The type of widget used for the parameter in the Editor.用于编辑器中参数的小部件类型。

If the type of widget is not specified, the most appropriate will be used (box fields for vector components or a slider). For the following types of parameters these widgets are set as defaults:如果未指定小部件的类型,将使用最合适的(矢量组件或滑块的框字段)。对于以下类型的参数,这些小部件被设置为默认值:

Parameter type Widget
Mask24 mask24
UV uv
Color сolor
Slider slider

min_expandmin_expand#

Boolean

A flag that enables the ability to specify values outside the minimum range limit.一个标志,可以指定超出最小范围限制的值。

Available values:可用值:

  • false — fix the minimum range limitfalse:修复最小范围限制
  • true — expand the minimum range limittrue:扩展最小范围限制

Default values:默认值:

  • false — for the Slider parameterfalse:用于 Slider 参数
  • true — for all the others parameterstrue:对于所有其他参数

max_expandmax_expand#

Boolean

A flag that enables the ability to specify values outside the maximum range limit.一个标志,可以指定超出最大范围限制的值。

Available values:可用值:

  • false — fix the maximum range limitfalse:修复最大范围限制
  • true — expand the maximum range limittrue:扩大最大范围限制

Default values:默认值:

  • false — for the Slider parameterfalse:用于 Slider 参数
  • true — for all the others parameterstrue:对于所有其他参数

expandexpand#

Boolean

A flag that enables the ability to specify values outside the minimum and maximum range limit.一个标志,可以指定超出最小和最大范围限制的值。

Available values:可用值:

  • false — fix the range limitfalse:修复范围限制
  • true — expand the range limittrue:扩大范围限制

Default values:默认值:

  • false — for the Slider parameterfalse:用于 Slider 参数
  • true — for all the others parameterstrue:对于所有其他参数

sharedshared#

Boolean

A flag that disables the passing of the parameter to shaders.禁止将参数传递给着色器的标志。

Available values:可用值:

  • false — do not pass the parameter to the shader as a variablefalse:不要将参数作为变量传递给着色器
  • true — pass the parameter to the shader as a variable (by default)true:将参数作为变量传递给着色器(默认情况下

internalinternal#

Boolean

A flag that hides the parameter in the Editor and its values are not saved for the inherited materials.在编辑器中隐藏参数的标志及其值不会为继承的材质保存。

  • false — do not hide the parameter and save its values for the inherited materials (by default)false:不隐藏参数并为继承的材质保存其值(默认
  • true — hide the parameter and do not save its values for the inherited materialstrue:隐藏参数并且不为继承的材质保存它的值

hiddenhidden#

Boolean

A flag that hides the parameter in the Editor. The default value depends on the state of the internal argument. Enabled by default, except for Slider.在编辑器中隐藏参数的标志。默认值取决于内部参数的状态。默认启用,Slider 除外。

  • false — do not hide the parameterfalse:不隐藏参数
  • true — hide the parametertrue:隐藏参数

auto_initauto_init#

Boolean

A flag that determines whether the parameter should be automatically declared in the shader.确定参数是否应在着色器中自动声明的标志。

  • false — auto initializedfalse:自动初始化
  • true — not auto initialized (by default)true:不自动初始化(默认

sizesize#

Integer

The size of an array (applicable only to array types), the default value is 0.数组的大小(仅适用于数组类型),默认值为0

passpass#

String

The set of passes during which the parameter will be used. If not specified the parameter is passed to all passes by default.将使用参数的通道集。如果未指定,则默认情况下将参数传递给所有传递。

Available values:可用值:

expressionexpression#

Boolean

A flag indicating if the parameter is controlled via an expression (UnigineScript). It also enables the ability to specify an expression in the Editor.指示参数是否通过表达(UnigineScript)。它还支持在编辑器中指定表达式。

Available values:可用值:

  • false — requires the user to assign specific values to the parameter (by default)false:要求用户为参数分配特定值(默认情况下
  • true — use expression to calculate the parameter's valuestrue:使用表达式计算参数的值
最新更新: 2024-02-06
Build: ()