Unity 2020 Virtual Reality Projects
eBook - ePub

Unity 2020 Virtual Reality Projects

Learn VR development by building immersive applications and games with Unity 2019.4 and later versions, 3rd Edition

Jonathan Linowes

Share book
  1. 592 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Unity 2020 Virtual Reality Projects

Learn VR development by building immersive applications and games with Unity 2019.4 and later versions, 3rd Edition

Jonathan Linowes

Book details
Book preview
Table of contents
Citations

About This Book

Explore the latest features of Unity and build VR experiences including first-person interactions, audio fireball games, 360-degree media, art gallery tours, and VR storytelling

Key Features

  • Discover step-by-step instructions and best practices to begin your VR development journey
  • Explore Unity features such as URP rendering, XR Interaction Toolkit, and ProBuilder
  • Build impressive VR-based apps and games that can be experienced using modern devices like Oculus Rift and Oculus Quest

Book Description

This third edition of the Unity Virtual Reality (VR) development guide is updated to cover the latest features of Unity 2019.4 or later versions - the leading platform for building VR games, applications, and immersive experiences for contemporary VR devices.

Enhanced with more focus on growing components, such as Universal Render Pipeline (URP), extended reality (XR) plugins, the XR Interaction Toolkit package, and the latest VR devices, this edition will help you to get up to date with the current state of VR. With its practical and project-based approach, this book covers the specifics of virtual reality development in Unity. You'll learn how to build VR apps that can be experienced with modern devices from Oculus, VIVE, and others. This virtual reality book presents lighting and rendering strategies to help you build cutting-edge graphics, and explains URP and rendering concepts that will enable you to achieve realism for your apps. You'll build real-world VR experiences using world space user interface canvases, locomotion and teleportation, 360-degree media, and timeline animation, as well as learn about important VR development concepts, best practices, and performance optimization and user experience strategies.

By the end of this Unity book, you'll be fully equipped to use Unity to develop rich, interactive virtual reality experiences.

What you will learn

  • Understand the current state of virtual reality and VR consumer products
  • Get started with Unity by building a simple diorama scene using Unity Editor and imported assets
  • Configure your Unity VR projects to run on VR platforms such as Oculus, SteamVR, and Windows immersive MR
  • Design and build a VR storytelling animation with a soundtrack and timelines
  • Implement an audio fireball game using game physics and particle systems
  • Use various software patterns to design Unity events and interactable components
  • Discover best practices for lighting, rendering, and post-processing

Who this book is for

Whether you're a non-programmer unfamiliar with 3D computer graphics or experienced in both but new to virtual reality, if you're interested in building your own VR games or applications, this Unity book is for you. Any experience in Unity will be useful but is not necessary.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Unity 2020 Virtual Reality Projects an online PDF/ePUB?
Yes, you can access Unity 2020 Virtual Reality Projects by Jonathan Linowes in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781839214257
Edition
3
Exploring Interactive Spaces
Successful virtual reality (VR) applications put the player into a believable place and allow them to explore and interact with objects in the environment. In this chapter, we'll explore the creation of an interactive space and introduce some new development topics, including level design, 3D modeling, and data management, to implement an interactive space you can experience in VR. The scene is a photo art gallery where you can showcase your own photos. We'll design a simple floor plan that your visitors can move around via teleportation.
You will learn how to use ProBuilder, Unity's built-in level design package, to create an architectural space, including extruding shapes to make walls, doors, and windows. You will also learn about data management using lists, data structures, and scriptable objects. In addition, you will gain more experience with lighting, materials, interaction, and teleportation components. By the end of the chapter, you'll have built a completed interactive art gallery where your visitors can explore your favorite images.
In this chapter, we are going to discuss the following topics:
  • Using ProBuilder in Unity to construct a simplistic art gallery building
  • Interacting with objects and metadata
  • Data structures, lists, and scriptable objects
  • Using teleportation

Technical requirements

To implement the projects and exercises in this chapter, you will need the following:
  • A PC or Mac with Unity 2019.4 LTS or later, an XR plugin for your device, and the XR interaction toolkit package installed
  • A VR headset supported by the Unity XR platform
You can access or clone the GitHub repository for this book (https://github.com/PacktPublishing/Unity-2020-Virtual-Reality-Projects-3rd-Edition-) to optionally use assets and completed projects for this chapter, as follows:
  • Asset files for you to use in this chapter are located in UVRP3Files/Chapter-10-Files.zip.
  • All completed projects in this book can be found in a single Unity project atUVRP3Projects.
  • The completed assets and scenes for this chapter can be found in theUVRP3Projects/Assets/_UVRP3Assets/Chapter10/folder.

Using ProBuilder and ProGrids

For this project, we're going to design an interactive art gallery. We just need a simple, small art gallery exhibit room, about 24 x 36 feet. The room is so simple, in fact, that it could easily be built within Unity using 3D cube primitives, but we'll take this opportunity to introduce you to the ProBuilder package included with Unity. If you prefer, you can skip this section and build the floor and walls using Unity cubes. Or, you could use the GalleryBuilding.obj file provided in the files for this chapter.
ProBuilder is a package of tools that allow you to build, edit, and texture geometry within Unity. It's intended to be used for in-scene level design, prototyping, and playtesting. In this project, we'll use ProBuilder just enough to get you started, along with the tools of its companion, ProGrids. Keep in mind that there's a lot more to it than will be covered in this chapter. For more information on ProBuilder, ProGrids, and Polybrush (introduced in Chapter 4, Using Gaze-Based Control), also check out the documentation and tutorials, including the following:
  • ProBuilder package documentationā€” https://docs.unity3d.com/Packages/com.unity.probuilder@latest/manual/overview.html
  • Unity at GDCā€”Rapid worldbuilding with ProBuilder video (March 29, 2018)ā€”https://www.youtube.com/watch?v=7k-81UEluyg
  • Unity Blogā€”ProBuilder joins Unity offering integrated in-editor Advanced Level Design (February 15, 2018)ā€”https://blogs.unity3d.com/2018/02/15/probuilder-joins-unity-offering-integrated-in-editor-advanced-level-design/
In this project, we will limit our use to a few ProBuilder features, including creating shapes, extruding and moving faces, creating and bridging edges, and snapping to a grid. The first step is to install the ProBuilder and ProGrids packages using the following steps:
  1. Open the Package Manager window by selecting Window | Package Manager.
  2. Ensure the filter dropdown in the upper-left corner of the window is set to All.
  3. Locate the package by typing Pro in the search field.
  4. Install ProBuilder by selecting ProBuilder from the list of packages, and then click Install.
  5. Also, install the Samples package for your render pipeline. Assuming you're using Universal Render Pipeline (URP) in this project, on the Universal Render Pipeline Support item, click Import into Project.
  6. Install ProGrids by selecting ProGrids from the list of packages, and then click Install.
Before using the tools for our project, let's take a quick tour of the editor interface for ProGrids and ProBuilder.

Using the ProGrids editor interface

Back in Chapter 2, Understanding Unity, Content, and Scale, I introduced the Unity Scene editor window, including the use of its built-in grid-snapping tools. ProGrids is an advanced version of this feature available in a separate package. Once installed (as per the preceding instructions), open the ProGrids window using Tools | ProGrids | ProGrids Window, and a new toolbar is added to the Scene window, on the left-hand side of the window, as shown in the following screenshot:
These ProGrids interface icons, from top to bottom, perform the following functions:
  • Snap Sizeā€”sets the size of the grid's snapping increment (default: 0.125 meters)
  • Grid Visibilityā€”toggles show/hide gridlines in the Scene view
  • Snapping Enabledā€”switches on/off the snap-to-grid behavior
  • Push to Gridā€”snaps all selected objects to the grid
  • Lock Gridā€”locks the perspective grid in place
  • Set Grid Planesā€”lets you choose to display grids for a single axis (X, Y, Z), or all three at once (3D).
Grid snapping operates on the transform of the objec...

Table of contents