Parameter Expressions

Collection Parameters

A Collection Parameter expression is used to reference a Parameter Collection asset. These are groups of parameters that can easily be reused by many different assets such as Materials, Blueprints, and much more. For more information on Parameter Collections, be sure to read the Parameter Collections Documentation.

A Material can reference, at most, two different MaterialParameterCollections. One is typically used for game-wide values while the other can be used for level specific parameters. A collection can have up to 1024 scalar parameters and 1024 vector parameters.

DynamicParameter

The DynamicParameter expression provides a conduit for particle emitters to pass up to four values to the material to be used in any manner. These values are set in Cascade via a ParameterDynamic module placed on an emitter.

Item

Description

Properties

Param Names

An array of the names of the parameters. The values here will determine the text displayed on the outputs of the expression in the Material Editor and will be the names used to reference the parameters in the ParameterDynamic module in Cascade.

Outputs

Param1

Outputs the value of the first parameter in the Param names property. The name of this output can change based on the values in the Param Names property.

Param2

Outputs the value of the second parameter in the Param names property. The name of this output can change based on the values in the Param Names property.

Param3

Outputs the value of the third parameter in the Param names property. The name of this output can change based on the values in the Param Names property.

Param4

Outputs the value of the fourth parameter in the Param names property. The name of this output can change based on the values in the Param Names property.

FontSampleParameter

The FontSampleParameter expression provides a way to expose a font-based parameter in a material instance constant, making it easy to use different fonts in different instances. The alpha channel of the font will contain the font outline value. Only valid font pages are allowed to be specified.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Font

Holds the default font asset (from the Content Browser) to be held within the expression.

Font Texture Page

The current font texture page to be used as a part of the texture.

FontSampleParameterExample.png

ScalarParameter

The ScalarParameter expression outputs a single float value (Constant ) that can be accessed and changed in an instance of the material or on the fly by code.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Default Value

Specifies the initial value that the constant takes on.

ScalarParameterExample.png

StaticBoolParameter

The StaticBoolParameter works like StaticSwitchParameter, except that it only creates a bool parameter and does not implement the switch.

This parameter is named static because it cannot change at runtime, it can only be set in the Material Instance Editor. Static Switches are applied at compile time, not at runtime. This means that whatever branch of the material was dropped will never be executed, so static switches are effectively free at runtime. On the other hand, a new version of the material must be compiled out for every used combination of static parameters in a material, which can lead to a shader explosion if abused. Try to minimize the number of static parameters in the material and the number of permutations of those static parameters that are actually used.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Default Value

The default bool value of the parameter, True (checked) or False.

This node is used with MaterialFunctions .

StaticSwitchParameter

The StaticSwitchParameter expression takes in two inputs, and outputs the first if the value of the parameter is true, and the second otherwise.

This parameter is named static because it cannot change at runtime, it can only be set in the Material Instance Editor. Static Switches are applied at compile time, not at runtime. This means that whatever branch of the material was dropped will never be executed, so static switches are effectively free at runtime. On the other hand, a new version of the material must be compiled out for every used combination of static parameters in a material, which can lead to a shader explosion if abused. Try to minimize the number of static parameters in the material and the number of permutations of those static parameters that are actually used.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Default Value

If true, the first input is output. Otherwise, the second input is output.

Extended Caption Display

If true, the title bar of the expressions displays the value of the expression.

Inputs

A

Takes in a value of any number of channels.

B

Takes in a value of any number of channels.

Example Usage: Static Switches can be used to remove an entire branch of a material with no runtime cost. Instances can have different values, making it possible to have a templated shader setup with no performance loss.

StaticSwitchParameterExample_A.png

StaticSwitchParameterExample_B.png

StaticComponentMaskParameter

The StaticComponentMaskParameter expression behaves just like an ordinary Component Mask, except that the mask values can be set by instances.

This parameter is named static because it cannot change at runtime, it can only be set in the Material Instance Editor. Static Switches are applied at compile time, not at runtime. This means that whatever branch of the material was dropped will never be executed, so static switches are effectively free at runtime. On the other hand, a new version of the material must be compiled out for every used combination of static parameters in a material, which can lead to a shader explosion if abused. Try to minimize the number of static parameters in the material and the number of permutations of those static parameters that are actually used.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Default R

If checked, the red, or first, channel of the input value will be passed through to the output.

Default G

If checked, the green, or second, channel of the input value will be passed through to the output.

Default B

If checked, the blue, or third, channel of the input value will be passed through to the output.

Default A

If checked, the alpha, or fourth, channel of the input value will be passed through to the output.

Example Usage: Static Component Masks can be used to let instances choose which channel of a mask texture to use. If the mask is static (does not need to change at runtime) then this approach should always be used instead of multiplying a texture lookup by a vector parameter to mask out channels, since this wastes texture bandwidth and shader instructions.

StaticComponentMaskParameterExample.png

VectorParameter

The VectorParameter expression is identical to the Constant4Vector , except that it is a parameter and can be modified in instances of the material and through code. One nicety of the VectorParameter is that its value can be set using the Color picker.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Default Value

  • R

  • G

  • B

  • A

The vector to output by default unless overridden by a MaterialInstanceConstant.

  • Specifies the float value of the red, or first, channel of the vector the expression outputs.

  • Specifies the float value of the green, or second, channel of the vector the expression outputs.

  • Specifies the float value of the blue, or third, channel of the vector the expression outputs.

  • Specifies the float value of the alpha, or fourth, channel of the vector the expression outputs.

VectorParameterExample.png

VertexColor is mutually exclusive with the Transform node due to limited interpolators. If you use both a Transform node and VertexColor, then VertexColor will come out all white.

Programmers: For sprite particles, colors are communicated to the shader per vertex, whereas colors for mesh particles are set as shader constants.

TextureObjectParameter

The TextureObjectParameter expression defines a texture parameter and outputs the texture object, used in materials that call a function with texture inputs. This node does not actually sample the texture, so it must be used in conjunction with a TextureSample node.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Texture

Specifies the texture sampled by the expression.

Sampler Type

The type of data that will be sampled and output from the node.

MipValueMode

Selects how to customize the sample's mip-level or derivatives from the default hardware computed. Affects the look and performance.

This node is used with MaterialFunctions .

TextureSampleParameter2D

The TextureSampleParameter2D expression is identical to the TextureSample except that it is a parameter that can be modified in instances of the material and through code.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Texture

Specifies the texture sampled by the expression.

Sampler Type

The type of data that will be sampled and output from the node.

MipValueMode

Selects how to customize the sample's mip-level or derivatives from the default hardware computed. Affects the look and performance.

Inputs

UVs

Takes in UV texture coordinates to use for the texture. If no values are input to the UVs, the texture coordinates of the mesh the material is applied to are used.

Outputs

RGB

Outputs the three-channel RGB vector value of the color.

R

Outputs the red channel of the color.

G

Outputs the green channel of the color.

B

Outputs the blue channel of the color.

A

Outputs the alpha channel of the color. If a texture does not contain an alpha channel, connecting the 'alpha' channel to something, while not technically illegal, will always result in zero (black).

TextureSampleParameterSubUV

The TextureSampleParameterSubUV expression is identical to the ParticleSubUV except that it is a parameter that can be modified in instances of the material and through code.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Blend

Blends together each frame of the SubUV sprite layout, rather than instantly "popping" from one frame to the next.

Texture

Specifies the texture sampled by the expression.

Sampler Type

The type of data that will be sampled and output from the node.

MipValueMode

Selects how to customize the sample's mip-level or derivatives from the default hardware computed. Affects the look and performance.

Inputs

UVs

The UV input is ignored and does nothing.

Outputs

RGB

Outputs the three-channel RGB vector value of the color.

R

Outputs the red channel of the color.

G

Outputs the green channel of the color.

B

Outputs the blue channel of the color.

A

Outputs the alpha channel of the color. If a texture does not contain an alpha channel, connecting the 'alpha' channel to something, while not technically illegal, will always result in zero (black).

TextureSampleParameterCube

The TextureSampleParameterCube expression is identical to the TextureSample except that it only accepts cubemaps and it is a parameter that can be modified in instances of the material and through code.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Texture

Specifies the texture sampled by the expression.

Sampler Type

The type of data that will be sampled and output from the node.

MipValueMode

Selects how to customize the sample's mip-level or derivatives from the default hardware computed. Affects the look and performance.

Inputs

UVs

Takes in UV texture coordinates to use for the texture. If no values are input to the UVs, the texture coordinates of the mesh the material is applied to are used. This must be a three-channel vector value.

Outputs

RGB

Outputs the three-channel RGB vector value of the color.

R

Outputs the red channel of the color.

G

Outputs the green channel of the color.

B

Outputs the blue channel of the color.

A

Outputs the alpha channel of the color. If a texture does not contain an alpha channel, connecting the 'alpha' channel to something, while not technically illegal, will always result in zero (black).

TextureSampleParameterMovie

The TextureSampleParameterMovie expression is identical to the TextureSample except that it only accepts movie textures (Bink movies) and it is a parameter that can be modified in instances of the material and through code.

Item

Description

Properties

Parameter Name

Specifies the name used to identify the parameter in instance of the material and through code.

Group

Provides a way to organize parameter names into groups, or categories, within a MaterialInstanceConstant. All parameters within a material that have the same Group property name will be listed underneath that category in the instance.

Texture

Specifies the texture sampled by the expression.

Sampler Type

The type of data that will be sampled and output from the node.

MipValueMode

Selects how to customize the sample's mip-level or derivatives from the default hardware computed. Affects the look and performance.

Inputs

UVs

Takes in UV texture coordinates to use for the texture. If no values are input to the UVs, the texture coordinates of the mesh the material is applied to are used.

Outputs

RGB

Outputs the three-channel RGB vector value of the color.

R

Outputs the red channel of the color.

G

Outputs the green channel of the color.

B

Outputs the blue channel of the color.

A

Outputs the alpha channel of the color. If a texture does not contain an alpha channel, connecting the 'alpha' channel to something, while not technically illegal, will always result in zero (black).

Tags