This example shows off the real-time reflection capabilities of Unreal Engine 4. The scene shows a rundown subway terminal with a lot of water leaks, grimy ceramic tiles, dilapidated pipe work, and other worn-out environment details. In this document, we will give an overview of some of the Functions that can be used to manipulate reflections like these.
Reflections Functions
The following is a list of all the functions underneath the Reflections category.
ReflectionVectorSoft
This function will soften a reflection vector based on an incoming normal map. The result is reflections that appear smoother across as surface. This is done by blending (via lerp) the normal map with a flat (0,0,1) normal map and then taking the reflection vector.
| Item | Description |
|---|---|
| Inputs | |
| Softness (Scalar) | Controls how much the existing normal map is smoothed, or blended with a flat normal map. |
| Normal (Vector3) | Takes in the incoming normal map that needs to be softened before a reflection vector is calculated. |
ViewAlignedReflection
This function takes in a spherical reflection texture and aligns it to the view. The calculation can be offset by inputting a custom reflection vector.
| Item | Description |
|---|---|
| Inputs | |
| ReflectionVector (Vector 3) | Takes in an existing reflection vector that needs to be aligned to the view. |
| ReflectionTexture (TextureObject) | Takes in an existing reflection texture, which needs to be spherical. |
| Outputs | |
| Texture | Outputs the resulting view-based reflection texture. |
| UVs | Outputs the UV coordinates of the reflection texture so they can be reapplied elsewhere. |
WorldAlignedReflection
This function takes in an incoming sphere-based reflection texture and aligns it to the world coordinates. The calculation can be offset by inputting a custom reflection vector.
| Item | Description |
|---|---|
| Inputs | |
| ReflectionVector (Vector 3) | Takes in an existing reflection vector that needs to be aligned to the view. |
| ReflectionTexture (TextureObject) | Takes in an existing reflection texture, which needs to be spherical. |
| Outputs | |
| WorldReflection | Outputs the world-based reflection texture. |
| WorldReflectionShadowed | Outputs a more highly contrasted version of the texture that can be applied in shadowed areas. |
CustomReflectionVector
This function uses a normal map to generate a reflection vector independent of the default reflection vector and the normal's input on the base shader.
| Item | Description |
|---|---|
| Inputs | |
| Normal (Vector3) | Takes in a normal map to be used as the basis for the custom reflection vector. |
