Overview
This section describes how to create planar reflection and shadow for objects visible in Augmented Reality, (rendered in the Foreground pass).
- ⚠️ This section assumes that the level is already lit with dynamic lights, objects are in the Foreground pass and casting shadows.
The objects casting shadows should be set as Stationary or Movable.
For more information about lighting tools and plugins in Unreal Engine, refer to: docs.unrealengine.com |
Setup
Create object shadows and reflections
The purpose of the object is to receive the reflection and shadow. To create an AR Shadows and Reflection Plane object:
1. Search for “AR Shadows and Reflection Plane” and drag and drop the object in the level.
2. Adjust the height (Z axis) of the “AR Shadows and Reflection Plane” in order to match the real floor’s height. The Target Displayer might be helpful to locate where the real floor is.
Cesium camera
The following step should be done for each Cesium Camera where the effect is visible:
1. Select the Cesium Camera (create one if it is not already done).
2. Bind the ARPlane object via the Details Panel at the section Video Output Key.
This will automatically add the “AR Shadows and Reflection Plane” object to the list of Foreground objects.
- The reflection and shadow are not displayed according to the Editor viewport’s camera. In order to visualize the final result, check the Cesium camera output in the VSAR Config panel or the video output.
Parameters
ARPlane object has the following parameters to alter the rendering.
- Mesh Component: The default Static Mesh is a plane. This property is accessible in case of custom shape (e.g. reflection on a rounded surface).
-
Reflection Texture Resolution: The resolution of the texture used for the reflection pass.
- Default: 1920x1080
- Material: For advanced usage with custom Materials (e.g. blur, alpha mask...),
- Enable Shadow: Enable/Disable shadow, default value is Enabled.
- Enable Reflection: Enable/Disable reflection, default value is Enabled.
- Shadow Opacity: Affects the shadow opacity, 1 is fully opaque and 0 is fully transparent.
- Default: 1
- Reflection Opacity: Affects the reflection opacity, 1 is fully opaque and 0 is fully transparent.
- Default: 0.5
Troubleshooting
The shadow is not visible or disappears after building the lighting.
Verify that the following parameters are correctly set:
- The level is lit and the light is casting shadows.
- Objects casting shadows are set as Stationary or Movable.
- Shadow opacity is different than 0.
- Object is in Foreground objects list.