Language:
Page Info
Tags:
Engine Version:

Android Vulkan Mobile Renderer

Choose your OS:

Vulkan_500px_Mar15.png

Unreal Engine 4 (UE4) has built in support for the Vulkan graphics API. Vulkan is a low-overhead, cross-platform 3D graphics library that gives developers more control over the GPU and lower level CPU usage for their Android base mobile projects. In the following document, we will go over how you can enable and use Vulkan in your UE4 Android projects.

Vulkan is currently under heavy development and should be considered a experimental feature at this point in time. If you wish to build and deploy a mobile project using Vulkan, you will need to download and compile UE4 version 4.12 or later from the UE4 Github branch.

Vulkan Video Drivers for PC Development

To make sure that you can visualize the rendering options Vulkan has available on your development PC, you will need to make sure you download and install the latest version of video card drivers for your graphics card. Below you will find the minimal driver version you need to use to be able to preview what Vulkan will look like on your development PC.

  • NVIDIA: Driver 367.27 or later

  • AMD: Driver 16.3 or later

Supported Vulkan Devices

Currently, only the following mobile device chipsets have support for the Vulkan API.

  • Nexus 6P (Android N Devices)

  • Galaxy S7 (Mali & Adreno variants)

Please note that the ability to use the Vulkan API depends on if your mobile carrier has released the Vulkain update for your specific device variant. To find if this support has been pushed to your mobile device, you will need to contact your mobile carrier.

Building for Vulkan

To build a UE4 project that has support for the Vulkan API you will need to do the following:

  1. Before you begin, make sure that you have your Android smartphone plugged into your development PC via USB and that your Android smartphone has developer mode enabled.

  2. Next, download and compile the latest version of UE4 from the UE4 Github branch as the binary version you get from the launcher will not allow you to build for Vulkan.

    If you are unsure how to do this check out the Download Unreal Engine Source Code page for detailed instruction on what to do.

  3. Then go to https://vulkan.lunarg.com/signin and in the download section, click on the Windows option.

    Click for full image.

    You do not need to sign in or create an account to download the Vulkan SDK.

  4. From the LunarG Vulkan SDK License Agreement page, change the version from Latest and then press the I Accept button to begin the download.

    Click for full image.

  5. Once the download completes, run the VulkanSDK-1.0.17.0 installer and follow the prompts to install the Vulkan SDK. When the Vulkan SDK has finished installing, reboot your PC to make sure that the environment variables are set properly.

  6. When your PC finished rebooting open up your system's Environment Variables and check for the Vulkan_SDK in the Variable section.

    VMP_Env_Vars.png

  7. Once UE4 has finshed building, Launch the UE4 Editor and create a new project using the following settings:

    • Blueprint Project

    • Blank Template

    • Mobile / Tablet

    • Maximum Quality

    • No Starter Content

    Click for full image.

    When that is completed, press the Create button to create and load the new project.

  8. Once the project has loaded go to Edit > Project Settings then under Engine go to the Rendering section and make sure that Mobile HDR has been enabled.

    Click for full image.

  9. Next, locate the Android section which is under Platforms.

    Click for full image.

  10. In the Android section under APKPackaging set the Minimum SDK Version to 19 and set the Target SDK Version to 19.

    Click for full image.

  11. Below the APKPackaging section in the Build section make sure that the following options are enabled.

    • Support arm7[aka armebi-v7a]

    • Support OpenGL ES2

    • Support Vulkan[Experimental]

    Click for full image.

  12. In the Android SDK section make sure that SDKConfig paths are pointed to the correct SDK on your development PC.

    Click for full image.

  13. From the menu bar go to File > Package Project > Android and select the Android(ASTC) option.

    Click for full image.

  14. Select a location for UE4 to save the Android build and then press the OK button to start the packaging process.

    Click for full image.

  15. When the packaging process has been completed, open up the folder that the packaged build was placed in. Inside this folder, you should see two .BAT files, locate the .BAT file that has the word Install in the name and double - click on it to install it to your device.

    Click for full image.

  16. Once installed on your device, press on the UE4 icon that has your project name under it to launch the project on the device.

    Click for full image.

Enabling Vulkan Preview Rendering in Editor

You can enable the ability to use the Vulkan render while inside of the UE4 Editor, you will need to do the following in your project:

  1. From the Main Toolbar go to the Edit option and then select the Editor Preferences option from the menu.

    VMP_00.png

  2. In the General section under the Experimental category, expand the Rendering section and click on the checkmark box next to the Enable Metal/Vulkan/High-end mobile Preview Rendering Level in editor.

    Click for full image.

    After doing this, the Editor will need to recompile the entire shader cache to include the required Vulkan options. Depending on the size of your project and power of your development computer, this process could take anywhere from a few minutes to an hour or more to complete.

  3. On the Main Toolbar, click on the Settings button and go to the Preview Rendering Level option and select the High-End Mobile / Metal option to enable OpenGL ES 3.1 previewing in the UE4 viewport.

  4. In the lower right-hand conner of the UE4 Editor viewport you should see the text, Feature Level: ES3_1. If you see this text then everything is setup correctly and you are now seeing what your project will look like when viewed on a device that supports the Vulkan API.

    Click for full image.

Enabling the Vulkan Mobile Preview Render

To enable the ability to use the Vulkan render with the mobile preview render, you will need to do the following in your project:

  1. From the Main Toolbar go to the Edit option and then select the Editor Preferences option from the menu.

    VMP_00.png

  2. In the General section under the Experimental category, expand the PIE section then click on the checkmark box next to the Allow Vulkan Mobile Preview option.

    Click for full image.

  3. On the Main Toolbar, change the Play Mode from Play this level in the selected viewport to the Vulkan Mobile Preview (PIE) option by clicking on the small white triangle next to the play button and selecting the Vulkan Mobile Preview (PIE) from the drop down list.

    VMP_02.png

  4. Click on the Play button that is on the Main Toolbar to launch your UE4 project in a new preview window with the Vulkan render enabled. If everything has been setup successfully, you should see something similar to the image below.

    Click for full image.

If you do not see (SF_VULKAN_ES31) at the top of the preview window next to the project name then that means the project is not using the Vulkan API.