Configuring your Unreal Project for AR/MR

For the plugin to work, there are a number of configurations that have to be set properly. Let’s step through them. Go to Edit -> Project Settings. You’ll see this window:

In Maps & Mode:

  • Change the GameMode to BP_ZED_GameMode
  • Change Game Instance Class to ZEDGameInstance

In General Settings:

  • Change the Game Viewport Client Class to ZEDGameViewportClient
  • Change LocalPlayerClass to ZEDLocalPlayer

  • Set Near Clip Plane to 1.0.

Next we’ll change graphics settings so that your project is optimized for AR experience with the ZEDmini. In Windows Explorer, go to your project folder, open the Config folder, and open DefaultEngine.ini.

Open it and scroll down to [/Script/Engine.RendererSettings]. If you don’t find it just copy-paste the below lines at the end of your file. Otherwise there will be a few lines underneath it, erase them and then paste the following ones :

[/Script/Engine.RendererSettings]
r.SceneRenderTargetResizeMethod=2
r.ForwardShading=False
r.DefaultFeature.AntiAliasing=1
r.DefaultFeature.MotionBlur=0
r.DefaultFeature.AmbientOcclusion=False
r.DefaultFeature.AmbientOcclusionStaticFraction=False
vr.InstancedStereo=False
r.SeparateTranslucency=0
r.HZBOcclusion=0
r.EyeAdaptionQuality=0
r.SSR.MaxRoughness=0
r.rhicmdbypass=0
r.TiledReflectionEnvironmentMinimumCount=10
r.TranslucentSortPolicy=0
r.PostProcessingColorFormat=0
r.DontLimitOnBattery=1
r.ScreenPercentage=100
vr.SteamVR.UsePostPresentHandoff=0
r.MaxQualityMode=0
r.DefaultFeature.LensFlare=0
t.UnacceptableFrameTimeThreshold=20
t.TargetFrameTimeThreshold=12.5
t.HitchFrameTimeThreshold=22.8
r.DefaultFeature.AutoExposure=False
r.TextureStreaming=False

Your DefaultEngine.ini file should look like this (you could also have some other sections in this file like [/Script/EngineSettings.GameMapsSettings] or [/Script/Engine.PhysicsSettings] for instance):

Now in the same folder than DefaultEngine.ini, create a new .txt file, rename it DefaultScalability.ini and open it. Paste the following lines inside:


[AntiAliasingQuality@0]
r.PostProcessAAQuality=0

[AntiAliasingQuality@1]
r.PostProcessAAQuality=2

[AntiAliasingQuality@2]
r.PostProcessAAQuality=3

[AntiAliasingQuality@3]
r.PostProcessAAQuality=3

;-----------------------------------------------------------------------------------------------------------------

[PostProcessQuality@0]
r.MotionBlurQuality=0
r.AmbientOcclusionLevels=0
r.LensFlareQuality=0
r.SceneColorFringeQuality=0
r.DepthOfFieldQuality=0
r.BloomQuality=1
r.FastBlurThreshold=0

[PostProcessQuality@1]
r.MotionBlurQuality=0
r.AmbientOcclusionLevels=0
r.LensFlareQuality=0
r.SceneColorFringeQuality=0
r.DepthOfFieldQuality=0
r.BloomQuality=2
r.FastBlurThreshold=0

[PostProcessQuality@2]
r.MotionBlurQuality=0
r.AmbientOcclusionLevels=0
r.LensFlareQuality=0
r.SceneColorFringeQuality=0
r.DepthOfFieldQuality=0
r.BloomQuality=3
r.FastBlurThreshold=0

[PostProcessQuality@3]
r.MotionBlurQuality=0
r.AmbientOcclusionLevels=0
r.LensFlareQuality=0
r.SceneColorFringeQuality=0
r.DepthOfFieldQuality=0
r.BloomQuality=4
r.FastBlurThreshold=0

;-----------------------------------------------------------------------------------------------------------------

[TextureQuality@0]
r.MaxAnisotropy=0

[TextureQuality@1]
r.MaxAnisotropy=2

[TextureQuality@2]
r.MaxAnisotropy=4

[TextureQuality@3]
r.MaxAnisotropy=8

;-----------------------------------------------------------------------------------------------------------------

[EffectsQuality@0]
r.TranslucencyVolumeBlur=0
r.TranslucencyLightingVolumeDim=4
r.SceneColorFormat=2
r.SSR.Quality=0

[EffectsQuality@1]
r.TranslucencyVolumeBlur=0
r.TranslucencyLightingVolumeDim=4
r.SceneColorFormat=2
r.SSR.Quality=0

[EffectsQuality@2]
r.TranslucencyVolumeBlur=0
r.TranslucencyLightingVolumeDim=8
r.SceneColorFormat=2
r.SSR.Quality=0

[EffectsQuality@3]
r.TranslucencyVolumeBlur=0
r.TranslucencyLightingVolumeDim=16
r.SceneColorFormat=2
r.SSR.Quality=0

This file change the engine scalability settings configuration in order to be optimized for AR. If you have any performance trouble when developing your application, you can easily change the engine scalability settings in the editor. This might improve your performance a lot depending of your scene content.

Your Config folder should now look like this :

Go back to the editor and you will see a notification at the bottom right that you need to restart it. Do so. Once you do, the skybox (background) in the editor may be different, but it’ll switch back to the white grid you saw before when it finishes building the shaders.