Texture Expressions

Expressions that sample and output textures.

Choose your operating system:

Windows

macOS

Linux

FontSample

The FontSample expression allows you to sample the texture pages out of a font resource as regular 2D textures. The alpha channel of the font will contain the font outline value. Only valid font pages are allowed to be specified.

Item

Description

Properties

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.

FontSampleExample.png

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

FontSampleParameterExample.png

SceneColor

The SceneColor expression outputs the existing scene color.

Item

Description

Inputs

OffsetFraction

Takes in a 2D vector that offsets the scene color in screen space. Setting this to either 0,1 or 1,0 will provide a slightly brighter version of the scene color. Setting it to 1,1 will provide an even brighter result.

SceneColorExample.png

SpriteTextureSampler

A custom sprite material can be created by duplicating one of the existing ones, or creating a new material in the Content Browser . When a sprite is rendered, the texture defined in a sprite asset will be piped into any texture parameters named "SpriteTexture" in the material. The SpriteTextureSampler node can be placed to do this automatically.

SpriteMaterial.png

Sprite instances will pass in their color as a vertex color, but it can be used for anything in the material, not just tinting.

Item

Description

Properties

Texture

Specifies the texture sampled by the expression. To set the texture, first select a texture in the Content Browser . Then, select the Texture property in the expression's property window and click the 'Use Current Selection' button.

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).

TextureObject

The TextureObject expression is used to provide a default texture for a texture function input within a function. This node does not actually sample the texture, so it must be used in conjunction with a TextureSample node.

Item

Description

Properties

Texture

The texture from the Content Browser that will be applied to this node.

Sampler Type

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

TextureSample

The TextureSample expression outputs the color value(s) from a texture. This texture can be a regular Texture2D (including normal maps), a cubemap, or a movie texture.

Item

Description

Properties

Texture

Specifies the texture sampled by the expression. To set the texture, first select a texture in the Content Browser . Then, select the Texture property in the expression's property window and click the 'Use Current Selection' button.

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. If the TextureSample represents a cubemap texture, the UVs coordinate must be a three-channel value rather than just a two-channel value.

DDX(UVs)

Takes the DDX of UVs input for anisotropic filtering. By default, the hardware automatically do it, and faster. But there is some cases where you may need to explicitly to set it avoiding the DDX material expresion to avoid artifacts like the 2x2 pixels block artifact of the deferred decal. Only available with MipValueMode = Derivative .

DDY(UVs)

Takes the DDY of UVs input for anisotropic filtering as same as DDX(UVs) takes the DDX of the UVs input.

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).

TextureSampleExample.png

For a better understanding of the DDX(UVs) and DDY(UVs) inputs, here is what you could do. But you need to keep in mind that this has the exact same output as with MipValueMode = None , but is slower. The DDX(UVs) and DDY(UVs) should only be used when you actually need to overide the default hardware computation because computing those values by a different way than using the DDX/DDY material expression.

SampleTextureDerivative.png

TextureProperty

The TextureProperty exposes a texture's property of your choice such as the texture's size or texel size.

TextureProperty.png

ParticleSubUV

The ParticleSubUV expression is used to render sub-images of a texture to a particle. ParticleSubUV is similar to a flipbook, except that ParticleSubUV allows the texture animation to be manipulated in Cascade.

Item

Description

Properties

Blend

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

Texture

Specifies the texture to use.

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).

ParticleSubUVExample.png

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).

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss