参数
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:语法如下:
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 / float4:UUSL 中 N 分量的浮点向量
- Int / Int2 / Int3 / Int4 — an integer (int) vector of N components in UUSLInt / Int2 / Int3 / Int4:UUSL 中 N 分量的整数 (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 values由2 个浮点值组成的数组 | float2[N] |
ArrayFloat4 | array of arrays of 4 float values由4 个浮点值组成的数组 | 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:例如,以下示例参数是使用表达式定义的:
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:它们可以在具有指定前缀的着色器中访问:
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).参数范围的最小限制(不适用于 Color 和 Array 类型)。
Default values:默认值:
maxmax#
Float
The maximum limit for a parameter range (not applicable for Color and Array types).参数范围的最大限制(不适用于 Color 和 Array 类型)。
Default values:默认值:
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:默认值:
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:默认值:
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:默认值:
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:可用值:
- custom_pass_name — name of a custom rendering pass (up to 32 custom passes are supported)custom_pass_name:自定义渲染通道的名称(最多支持 32 自定义通道)
- wireframe — the wireframe passwireframe:线框通道
- visualizer_solid — the visualizer solid passvisualizer_solid:可视化器实体通道
- lightmap_data - the lightmap baking passlightmap_data:光照贴图烘焙通道
- deferred — the deferred passdeferred:延期通行证
- auxiliary — the auxiliary passauxiliary:辅助通行证
- emission — the emission passemission:发射通行证
- refraction — the refraction pass折射:折射通道
- transparent_blur — the transparent blur passtransparent_blur:透明模糊通道
- ambient — the ambient passambient:环境通行证
- light_voxel_probe — the Voxel Probe light passlight_voxel_probe:Voxel Probe 光通道
- light_environment_probe — the Environment Probe passlight_environment_probe:Environment Probe 通行证
- light_planar_probe — the Planar Probe pass light_planar_probe:Planar Probe 通行证
- light_omni — the Omni Light passlight_omni:Omni Light 通行证
- light_proj — the Proj Light passlight_proj:Proj Light 通行证
- light_world — the World Light passlight_world:World Light 通行证
- depth_pre_pass — the native depth pre-passdepth_pre_pass:原生深度预通
- ms_depth - the SRAA passms_depth:SRAA 通行证
- shadow — the shadows passshadow:影子过去了
- post — the post-process passpost:后处理通行证
- procedural_decals - the procedural decal passprocedural_decals:程序贴花通行证
- procedural_fields - the procedural field passprocedural_fields:程序现场通行证
- light_all — the Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light passeslight_all:Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light 通行证
- forward — the Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light and ambient passesforward:Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light 和周围的通行证
- transparent — the forward, refraction, transparent blur passes透明:这向前,折射,透明模糊通行证
- object — deferred, auxiliary, emission, refraction, transparent blur, ambient, Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light, shadow and native depth passesobject:延期,辅助的,排放,折射,,透明模糊,周围的, Voxel Probe, Environment Probe, Planar Probe, Omni Light, Projected Light, World Light,阴影和本机深度通道
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:使用表达式计算参数的值