**ActorPositionWS** outputs Vector3 (RGB) data representing the location of the object with this material on it in world-space.

In this example, you can see that ActorPositionWS is being fed directly into the Base Color of the material. As a result, each of the spheres with the material applied to them show a different color as they are moved to different locations in 3D space. Note that the result of the ActorPositionWS node is being divided by 1600 to create a nice blend-in color, rather than a pop.

The **CameraWorldPosition** expression outputs a three-channel vector value representing the camera's position in world space.

The preview sphere changes color as the camera rotates.

The **CameraVector** expression outputs a three-channel vector value representing the direction of the camera with respect to the surface, in other words, the direction from the pixel to the camera.

**Example Usage:** CameraVector is often used to fake environment maps by connecting the CameraVector to a ComponentMask and use the x and y channels of the CameraVector as texture coordinates.

The **Constant2Vector** expression outputs a two-channel vector value, in other words, two constant numbers.

Item | Description |
---|---|

Properties | |

| Specifies the float value of the red (first) channel of the vector the expression outputs. |

| Specifies the float value of the green (second) channel of the vector the expression outputs. |

**Examples:** (0.4, 0.6), (1.05, -0.3)

**Example Usage:** The Constant2Vector is useful for modifying texture coordinates, as they are two-channel values as well.

You can quickly create a Constant2Vector node by holding the **2** key and **Left Mouse Click** in the graph area of the Material Editor.

The **Constant3Vector** expression outputs a three-channel vector value, in other words, three constants numbers. An RGB color can be thought of as a Constant3Vector, where each channel is assigned to a color (red, green, blue).

Item | Description |
---|---|

Properties | |

| Specifies the float value of the red (first) channel of the vector the expression outputs. |

| Specifies the float value of the green (second) channel of the vector the expression outputs. |

| Specifies the float value of the blue (third) channel of the vector the expression outputs. |

**Examples:** (0.4, 0.6, 0.0), (1.05, -0.3, 0.3)

You can quickly create a Constant3Vector node by holding the **3** key and **Left Mouse Click** in the graph area of the Material Editor.

The **Constant4Vector** expression outputs a four-channel vector value, in other words, four constants numbers. An RGBA color can be thought of as a Constant4Vector, where each channel is assigned to a color (red, green, blue, alpha).

Item | Description |
---|---|

Properties | |

| Specifies the float value of the red (first) channel of the vector the expression outputs. |

| Specifies the float value of the green (second) channel of the vector the expression outputs. |

| Specifies the float value of the blue (third) channel of the vector the expression outputs. |

| Specifies the float value of the alpha (fourth) channel of the vector the expression outputs. |

**Examples:** (0.4, 0.6, 0.0, 1.0), (1.05, -0.3, 0.3, 0.5)

You can quickly create a Constant4Vector node by holding the **4** key and **Left Mouse Click** in the graph area of the Material Editor.

This expression has been deprecated in Unreal Engine 4 as lighting calculations are now deferred.

The **Object Bounds** expression outputs the size of the object in each axis. If used as color, the X, Y, and Z axes correspond to R, G, and B, respectively.

In the example above, you can see that the colors of the objects correspond to the longest axis of the object.

The **ObjectOrientation** expression outputs the world-space up vector of the object. In other words, the object's local positive z-axis is pointing in this direction.

The **ObjectPositionWS** expression outputs the world-space center position of the object's bounds. For example, this is useful for creating spherical lighting for foliage.

The **ParticlePositionWS** expression outputs Vector3 (RGB) data representing each individual particle's position in world space.

In this image, ParticlePositionWS is being fed into emissive color to visualize the data. The particle system has been scaled up to show how the color is changing based on position.

The **PixelNormalWS** expression outputs vector data representing the direction that pixels are facing based on the current normal.

In this example, PixelNormalWS is fed into Base Color. Notice how the normal map is used to give the per-pixel result.

The **Pre-Skinned Local Normals** Vector Expression outputs a three-channel vector value representing the local surface normal for Skeletal and Static Meshes. This enables you to achieve locally-aligned tri-planar
materials and mesh aligned effects in your materials.

In this example, the material is using a tri-planar texture aligned to the mesh's local surface normal.

Tri-Planar Pre-Skinned Local Normal Vector Expression | Tri-Planar Material |

The **Pre-Skinned Local Position** Vector Expression outputs a three-channel vector value that gives access to a Skeletal Meshâ€™s default pose position data for use in
per-vertex outputs. This enables you to have localized effects on an animated character. This vector expression can also be used with Static Meshes, which will return
the standard local position.

In this example, the Skeletal Mesh's default pose is used for mapping versus the default UV mapping on the right.

Pre-Skinned Local Position Vector Expression | Skeletal Mesh's Default UV Layout |

The **ReflectionVectorWS** expression is similar in spirit to CameraVectorWS, but it outputs a three-channel vector value representing the camera direction reflected across the surface normal.

**Example Usage:** ReflectionVector is commonly used in environment maps, where the x/y components of the reflection vector are used as UVs into a cubemap texture.

The **VertexNormalWS** expression outputs the world-space vertex normal. It can only be used in material inputs that are executed in the vertex shader, like WorldPositionOffset. This is useful for making a mesh grow or shrink. Note that offsetting position along the normal will cause the geometry to split apart along UV seams.

In the example above, the preview sphere would seem to scale up and down with sinusoidal motion, as each of the vertices moved in their own normal directions.

The Vector Noise Material expression adds several more 3D or 4D vector noise results to use in your Materials. Due to the run-time expense of these functions, it is recommended that once a look is developed with them, all or part of the computation be baked into a Texture using the Draw Material to Render Target Blueprint feature introduced in Unreal Engine 4.13 and later. These Material graph Expressions allow procedural looks to be developed in the engine on final assets, providing an alternative to creating procedurally generated Textures with an external tool to apply to assets in UE4. Inside of the Vector Noise Material Expression, you will find the following Vector Noise types.

Image | Item | Description |
---|---|---|

| Returns a random color for each cell in a 3D grid (i.e. from the mathematical floor operation applied to the node input). The results are always consistent for a given position, so can provide a reliable way to add randomness to a Material. This Vector Noise function is extremely cheap to compute, so it is not necessary to bake it into a Texture for performance. | |

| Returns a random color for each cell in a 3D grid (i.e. from the mathematical floor operation applied to the node input). The results are always consistent for a given position, so can provide a reliable way to add randomness to a Material. This Vector Noise function is extremely cheap to compute, so it is not necessary to bake it into a Texture for performance. | |

| Computes the analytical 3D gradient of a scalar Perlin Simplex Noise. The output is four channels, where the first three (RGB) are the gradient, and the fourth (A) is the scalar noise. This noise type is useful for bumps on a surface or for flow maps. | |

| Computes the analytical 3D curl of a vector Perlin Simplex Noise (aka Curl Noise). The output is a 3D signed curl vector and is useful for fluid or particle flow. | |

| Computes the same Voronoi noise as the scalar Noise material node. The scalar Voronoi noise scatters seed points in 3D space and returns the distance to the closest one. The Vector Noise version returns the location of the closest seed point in RGB, and the distance to it in A. Especially coupled with Cellnoise, this can allow some randomized behavior per Voronoi cell. |

Below is a simple stone bed material using the distance component of the Vector Noise / Voronoi to modulate some surface bumps and blend in moss in the cracks, and the seed position together with Vector Noise / Cellnoise to change the color and bump height per rock.

The derivative-based operations Perlin Curl and Perlin Gradient can be added together in octaves, just as regular Perlin noise can. For derivatives of more complex expressions, it is necessary to compute the gradient of the result of the expression. To help with this, place the expression to compute into a Material Function and use it with the following helper nodes.

Item | Description |
---|---|

| Uses positions offset in a tetrahedral pattern to compute 3D derivatives. Evaluate the same 3D function at each offset position produced by this function, then feed the resulting values into Compute3DDeriv. |

| Uses positions offset in a tetrahedral pattern to compute 3D derivatives. Use with Prepare3DDeriv. |

| Computes 3D gradient vector from result of Prepare3DDeriv/Compute3DDeriv. |

| Computes curl of a 3D vector field from result of Prepare3DDeriv/Compute3DDeriv. |

These helper Material Functions use four evaluations of the base expression spaced in a tetrahedral pattern to approximate these derivative-based operations.

Below you will find descriptions of the various noise functions you will find in the Vector Noise Material Expression.

Item | Description |
---|---|

Properties | |

| |

| A look/performance setting. Lower values are faster but may look worse, higher values are slower but may look better. |

| For noise functions that support it this allows noise to tile. This is more expensive, but useful when baking noise into a seamless wrapping texture. |

| When tiling, how often should the noise repeat. For Perlin noise variants, the Tile Size must be a multiple of three. |

Inputs | |

| Allows the texture size to be adjusted via a 3D vector. |

**Cell Noise**Material Example:**Perlin Gradient**Material Example:**Voronoi**Material Example: