Book Image

Unity Virtual Reality Projects - Second Edition

By : Jonathan Linowes
Book Image

Unity Virtual Reality Projects - Second Edition

By: Jonathan Linowes

Overview of this book

Unity has become the leading platform for building virtual reality games, applications, and experiences for this new generation of consumer VR devices. Unity Virtual Reality Projects walks you through a series of hands-on tutorials and in-depth discussions on using the Unity game engine to develop VR applications. With its practical and project-based approach, this book will get you up to speed with the specifics of VR development in Unity. You will learn how to use Unity to develop VR applications that can be experienced with devices such as Oculus, Daydream, and Vive. Among the many topics and projects, you will explore gaze-based versus hand-controller input, world space UI canvases, locomotion and teleportation, software design patterns, 360-degree media, timeline animation, and multiplayer networking. You will learn about the Unity 3D game engine via the interactive Unity Editor, and you will also learn about C# programming. By the end of the book, you will be fully equipped to develop rich, interactive VR experiences using Unity.
Table of Contents (15 chapters)

Types of head-mounted displays

Presently, there are two basic categories of HMDs for virtual reality—desktop VR and mobile VR, although the distinctions are increasingly becoming blurred. Eventually, we might just talk about platforms as we do traditional computing, in terms of the operating system—Windows, Android, or console VR.

Desktop VR

With desktop VR (and console VR), your headset is a peripheral to a more powerful computer that processes the heavy graphics. The computer may be a Windows PC, Mac, Linux, or a game console, although Windows is by far the most prominent PC and the PS4 is a bestseller in terms of console VR.

Most likely, the headset is connected to the computer with wires. The game runs on the remote machine and the HMD is a peripheral display device with a motion sensing input. The term desktop is an unfortunate misnomer since it's just as likely to be stationed in either a living room or a den.

The Oculus Rift (https://www.oculus.com/) is an example of a device where the goggles have an integrated display and sensors. The games run on a separate PC. Other desktop headsets include the HTC VIVE, Sony's PlayStation VR, and Microsoft immersive Mixed Reality.

Desktop VR devices rely on a desktop computer (usually via video and USB cables) for CPU and graphics processing unit (GPU) power, where more is better. Please refer to the recommended specification requirements for your specific device.

However, for the purpose of this book, we won't have any heavy rendering in our projects, and you can get by with minimum system specifications.

Mobile VR

Mobile VR originated with Google Cardboard (https://vr.google.com/cardboard/), a simple housing device for two lenses and a slot for your mobile phone. The phone's display is used to show the twin stereoscopic views. It has rotational head tracking, but it has no positional tracking. The Cardboard also provides the user with the ability to click or tap its side to make selections in a game. The complexity of the imagery is limited because it uses your phone's processor for rendering the views on the phone display screen.

Google Daydream and Samsung GearVR improved the platforms by requiring more performant minimum specifications including greater processing power in the mobile phone. GearVR's headsets include motion sensors to assist the phone device. These devices also introduced a three-degrees-of-freedom (DOF) hand controller that can be used like a laser pointer within VR experiences.

The next generation of mobile VR devices includes all-in-one headsets, like Oculus Go, with embedded screens and processors, eliminating the need for a separate mobile phone. Newer models may include depth sensors and spatial mapping processors to track the user's location in 3D space.

The bottom line is, the projects in this book will explore features from the high end to the low end of the consumer VR device spectrum. But generally, our projects do not demand a lot of processing power nor do they require high-end VR capability, so you can begin developing for VR on any of these types of devices, including Google Cardboard and an ordinary mobile phone.

If you are interested in developing VR applications for Google Daydream on Android directly in Java rather than through the Unity game engine, please also refer to another of the author's books, Cardboard VR Projects for Android from Packt Publishing (https://www.packtpub.com/application-development/cardboard-vr-projects-android).