UE4 Material (3): Material Expression

Excerpted from and compiled from the Unreal official tutorial: https://learn.unrealengine.com/course/2449699
Project file download in the course:
Link: https://pan.baidu.com/s/1o7m3pR7BvaCYAmlx57B9HQ Extraction code: uenb

  • There are many material expressions that can be used as nodes when creating materials, but there are only seven commonly used ones: Texture Sample, Constant, Constant3Vector, TextureCoordinate, Panner ), multiplication (Multiply) and interpolation (Lerp).

  • For more material expressions, please refer to the official website documentation: Material Expressions

1. Texture Sample

Carrying the texture that needs to be drawn, the portal: UE4 material (1): texture Textures
Texture Sample

Second, the constant (Constant)

A float type value that can represent a grayscale color

Constant
Constant
Constant

Three, constant 3 vector (Constant3Vector)

A vector composed of 3 floats, which can represent a color
Constant3Vector

Four, texture coordinates (TextureCoordinate)

The coordinate input of texture sampling can control the scaling of texture

TextureCoordinate
TextureCoordinate

5. Panner

Controls the translation of the texture when sampling
Pans

Six, multiplication (Multiply)

Multiply values, but must be of the same type

For example, float * float, float3vector * float3vector (three floats are multiplied one by one to get a new float3vector)

  • 1. The texture is multiplied by a color, and the texture can be dyed to that color
    Multiply

  • 2. The texture is multiplied by a constant to change the brightness of the texture
    Multiply

7. Interpolation (Lerp)

Linear interpolation, mixing A and B in different proportions

Output = Alpha * A + (1 - Alpha) * B

  • 1. When Alpha is 0, fully sample A rock texture
    Lerp

  • 2. When Alpha is 1, fully sample B grass texture
    Lerp

  • 3. When Alpha is 0.5, half of the AB textures are sampled for mixing, including rocks and grass
    Lerp

For more material expressions, please refer to the official website documentation: Material Expressions

Guess you like

Origin blog.csdn.net/q345911572/article/details/124633375