gerardfriel.com

Digital Learning Design

gerard-friel
  • Home
  • Instructional Design
  • Game-Based Learning
    • Game-based Learning Overview
    • Gamification
  • Learning Technology
    • Artificial Intelligence
    • Augmented Reality
    • Unreal Engine
  • Blog
  • About
    • Contact

HoloLens 2 development in Unreal Engine

HoloLens 2 development in Unreal Engine

Here are some useful findings when developing in Unreal Engine for the HoloLens 2:

  1. Getting started and installing the required plugins
  2. Creating a HoloLens 2 project in Unreal Engine
  3. Optimising project settings for augmented reality

Getting started and installing the required plugins

To start developing for the HoloLens 2, you need to update and install additional components to the Windows operating system, Visual Studio, and Unreal Engine.

Windows Icon

Windows setup

Windows 1010 1809 or later
Enable Developer settings (Update & Security > For developers > Toggle on)    
Windows SDKWindows SDK >= build 18362 (Can include this using the Visual Studio Installer)
Visual Studio

Visual Studio setup

Visual Studio 2019Latest version and workloads (Open VS Installer from Windows menu)
* Desktop development with C++
* .NET desktop development Windows 10 SDK (>= 10.0.18x)
* Universal Windows Platform (UWP) development
* + USB Device Compatibility
* + C++(v142) UWP tools
* Required Disk Space = Total 17 Gig in the Visual Studio C:Drive

Unreal Engine setup

Install UE4Downloads > login (version 4.25 or above)
Install/EnableHoloLens 2  
UE4 PluginsPlugins > Augmented Reality > HoloLens
Plugins > Virtual Reality > Microsoft Windows Mixed Reality
UE4 UXTools PluginUX Tools > Download .zip file from GitHub via releases
Unzip into the UE Project Plugins folder (create if doesn’t exist)
Install via UE Editor (will automatically pick up the plugins added)
Show plugin content from editor view to view folder structure within the project

Creating a HoloLens 2 project in Unreal Engine

Create a new project

When creating a new blank project in Unreal Engine, choose C++ as the type of project if you wish to package to a HoloLens 2 device, and set the quality to ‘Scalable 3D or 2D’, target ‘Mobile / Tablet’ (as the HoloLens is like a mobile device with limited computing processing compared to a desktop PC), disable ‘Raytracing’ and don’t include starter content.

Unreal engine project settings Hololens 2

Optimising project settings for Augmented Reality

Performance

To optimise the project for the Hololens 2, under: Project Settings > Engine > Rendering >

Mobile > Disable vertex fogging in mobile shaders = TRUE

Mobile > Maximum number of CSM cascades to render = 1

Culling > Occlusion Culling = FALSE

Forward Renderer > Forward Shading = TRUE

VR > Instanced Stereo = TRUE, Mobile HDR = FALSE, Mobile Multi-View = TRUE

AR Config

To manage the AR session, create an ARSessionConfig Data Object.

Add > Misc > Data Object > ARSessionConfig and rename it ‘ARSessionConfig’.

Set both ‘Generate Mesh Data from Tracked Geometry’ and ‘Track Scene Objects’ to TRUE and save.

On event begin play, start the AR session using the Session Config file created earlier. This can be created using the Blueprint editor.

UE ARSessionConfig to start an AR session.

On event end play, add the component ‘Stop AR Session’.

MR Pawn

The Pawn in Unreal Engine is the player, and this ‘Pawn’ can be optimised for Augmented Reality. Create a custom Pawn named ‘MRPawn’ to use in the project.

Add > Blueprints > Blueprint Class > DefaultPawn and rename it to ‘MRPawn’.

To avoid the ‘player’ from banging into things, remove the collision from the new Pawn. Double-click the MRPawn to edit and select ‘NoCollision’ from the Collision Presets. Do the same for the Mesh Component. Select the Collision Component and add a camera.

Using the MRPawn via Gamemode

To use your new Pawn, it needs to set up in the Gamemode component.

Add > Blueprint > Blueprint Class > (type ‘gamemodebase’ ) > select one

Double-click ‘gamemode’ and ‘Set Default Pawn’ to ‘MRPawn’, compile and save.

Set default map and gamemode on startup.

Now you have a custom MRPawn that is called from the gamemode, setup the default map (or scene) that opens when the project starts.

Settings > Project Settings > Maps & Modes, and then select the gamemode and your default map.

Summary

This post included some useful tips for developing for the HoloLens 2 in Unreal Engine and covered:

  1. Getting started and installing the required plugins
  2. Creating a HoloLens 2 project in Unreal Engine
  3. Optimising project settings for augmented reality
  • Bluesky
  • LinkedIn
  • Pinterest
  • Twitter

Home

  • Instructional Design Overview
  • Adult Learning
  • Behaviourism
  • Cognitivism
  • Constructivism
  • Connectivism
  • 4-Door Model
  • Action Mapping
  • ADDIE Model
  • Agile
  • CCAF
  • Cognitive Load Theory
  • Empathy Mapping
  • Gagne’s 9 Events of Instruction
  • Game-Based Learning Overview
  • Gamification
  • Merrill’s First Principles of Instruction
  • Revised Bloom’s Taxonomy Review
  • SAM
  • Social Learning Theory
  • Augmented Reality
  • Design Thinking
  • Artificial Intelligence

Copyright © gerardfriel.com