0%

Book Description

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.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Unity 2020 Virtual Reality Projects Third Edition
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Reviews
  7. Virtually Everything for Everyone
    1. What is virtual reality?
    2. Differences between virtual reality and augmented reality
    3. Applications versus games
    4. Types of VR experience
    5. Types of HMD
      1. Desktop VR
      2. Mobile VR
    6. How virtual reality works
      1. Stereoscopic 3D viewing
      2. Head, hand, and body tracking
    7. Technical skills that are important to VR
    8. What this book covers
      1. Who this book is for
    9. Summary
  8. Understanding Unity, Content, and Scale
    1. Technical requirements
    2. Installing Unity
      1. Development system requirements
      2. Installing Unity Hub
      3. Installing the Unity Editor
      4. Creating a new Unity project
      5. Installing additional packages and assets
    3. Getting started with Unity
      1. Exploring the Unity Editor
      2. Understanding the default new scene
      3. Using grid and snap
      4. A couple more options
    4. Creating a simple diorama
      1. Adding a cube and a plane
      2. Adding a red ball
      3. Changing the scene view
      4. Making a Crate Material
      5. Adding a photo
    5. Using prefabs
      1. Creating and instantiating a prefab
      2. Editing and overriding a prefab
    6. Importing content
      1. Creating 3D content for VR
      2. Importing from the Unity Asset Store
      3. Using Unity Legacy Standard Assets
      4. Importing models in supported formats
      5. Round-trip geometry workflows
    7. Summary
  9. Setting Up Your Project for VR
    1. Technical requirements
    2. Introducing the Unity XR platform
    3. Choosing your target VR platforms and toolkits
    4. Enabling virtual reality for your platform
      1. Setting your target platform
      2. Installing XR Plugin Management
      3. Installing the XR Interaction Toolkit
      4. Adding the XR camera rig
      5. Exploring the XR Rig objects and components
    5. Building and running your project
      1. Configuring the player settings
      2. Building, running, and testing your VR project
    6. Building for SteamVR
      1. Setting up for OpenVR
      2. Installing the SteamVR Unity Plugin toolkit
    7. Building for Oculus Rift
      1. Setting up for Oculus desktop
      2. Installing the Oculus Integration toolkit
    8. Building for Immersive Windows MR
      1. Setting up for Immersive WMR
      2. Installing Visual Studio workloads
      3. Installing the Mixed Reality Toolkit (MRTK)
    9. Building for Oculus Quest
      1. Installing the Android tools
      2. Setting up for Oculus mobile VR
      3. Other Android and optimization settings
      4. Installing the Oculus Integration toolkit
      5. Using adb
    10. Building for Google Cardboard
      1. Setting up for Google Cardboard
      2. Targeting Android for Cardboard
      3. Targeting iOS for Cardboard
    11. Summary
  10. Using Gaze-Based Control
    1. Technical requirements
    2. Adding Ethan, the walker
      1. Artificially intelligent Ethan
      2. The NavMesh bakery
    3. Scripting a random walk target
    4. "Zombie-izing" Ethan!
      1. Adding a zombie material
      2. Painting models with Polybrush
    5. Going where I'm looking
      1. The LookMoveTo script
      2. Adding a feedback cursor object
      3. Observing through obstacles
    6. Making a look-to-kill system
      1. The KillTarget script
      2. Adding particle effects
    7. Introducing Unity C# programming
    8. Summary
  11. Interacting with Your Hands
    1. Technical requirements
    2. Setting up the scene
      1. Defining a balloon game object
      2. Making the balloon prefab
      3. Creating a Balloon Controller
    3. Using an Input Manager button
      1. Polling the XRI_Right_Trigger button
    4. Controlling balloons with the input trigger
      1. Creating balloons
      2. Releasing balloons
      3. Inflating a balloon while pressing the trigger
    5. Using Unity events for input
      1. Invoking our input action events
      2. Subscribing to input events
    6. Tracking your hands
      1. Parenting the balloon to your hand
      2. Forcing balloons to float upright
    7. Interacting with a balloon gun
      1. Introducing the XRI Interactor/Interactable architecture
      2. Creating a grabbable balloon gun
      3. Handling Activate events
      4. Using the XR Interaction Debugger
    8. Popping balloons
      1. Making the balloons poppable
      2. Adding a popping explosion
      3. Disabling rigid physics while in hand
      4. Throwing a ball projectile
      5. Resetting the ball position
    9. Summary
  12. Canvasing the World Space UI
    1. Technical requirements
    2. Studying VR design principles
    3. Making a reusable default canvas
      1. Creating a default canvas prefab
      2. Initializing the default main camera
      3. Including an Event System component with XRUI Input Module
    4. Implementing a HUD
      1. Creating a visor HUD
      2. The windshield HUD
      3. Hiding the panel using Canvas Group
    5. The in-game world space UI
      1. Making a scoreboard
      2. Using TextMesh Pro
      3. Info bubbles
    6. The reticle cursor
      1. Adding a canvas reticle to gaze-based interaction
      2. Adding a reticle to the XR interactor hand controller
      3. Adding a gaze-based reticle using XRI
    7. Building an interactive dashboard
      1. Adding a dynamic water hose
      2. Creating a dashboard with a toggle button
      3. Stopping the ray interactor at the canvas
    8. Direct interaction with UI elements
    9. Building a wrist-based menu palette
    10. Summary
  13. Teleporting, Locomotion, and Comfort
    1. Technical requirements
    2. Implementing basic glide locomotion
      1. Moving forward with the thumbstick
      2. Rotating with the thumbstick
      3. Moving in the direction you're looking or pointing
      4. Avoiding obstacles
    3. Climbing a wall
      1. Building a wall with grab holds
      2. Adding the XRI Interactor and Interactable components
      3. Adding a ClimbController script
      4. Adding the GrabPull script and actions
      5. Falling
    4. Using the XRI Locomotion System
      1. Understanding the Locomotion System
      2. Turning in a snap
      3. Integrating scripts with Locomotion System
    5. Teleporting between locations
      1. Installing the XRI examples
      2. Adding teleportation
      3. Restricting interaction to a specific layer
      4. Ray interactors for teleportation
      5. Switching between Interactors
    6. Locomotion and comfort in VR
      1. Other locomotion mechanics
      2. Managing VR motion sickness
    7. Summary
  14. Lighting, Rendering, Realism
    1. Technical requirements
    2. Lighting and rendering strategies
      1. Choosing a Render Pipeline
      2. Choosing Lighting Settings and GameObjects
    3. Setting up our demo scene
      1. Using the SampleScene
      2. Disabling baked lighting
      3. Creating a menu panel
    4. Using environment lighting
      1. Environment lighting source
      2. Adding Environment Light Intensity
      3. Adding a Fog effect
    5. Using PBR materials and URP Shaders
    6. Using Light objects and Emission surfaces
    7. Using Light Probes and Reflection Probes
    8. Enhancing your scenes with post-processing effects
    9. Summary
  15. Playing with Physics and Fire
    1. Technical requirements
    2. Understanding Unity physics
    3. Creating bouncy balls
    4. Managing the GameObject life cycle
      1. Removing fallen objects
      2. Setting a limited lifetime
      3. Implementing an object pool
    5. Building a headshot game
      1. Serving a ball
      2. Adding sound effects
      3. Hitting the target
    6. Building a Paddleball game
      1. Creating a hand paddle
    7. Building a shooter ball game
      1. Making a shooter wall
      2. Shooting balls toward the player
      3. Improving the ball
    8. Juicing the scene
      1. Great balls of fire
      2. Skull environment
      3. Audio synchronization
    9. Summary
  16. Exploring Interactive Spaces
    1. Technical requirements
    2. Using ProBuilder and ProGrids
      1. Using the ProGrids editor interface
      2. Using the ProBuilder editor interface
    3. Constructing the art gallery building
      1. Using a floor plan sketch
      2. Creating the floor
      3. Creating the walls
      4. Making holes for entrances
      5. Creating a roof and skylight
    4. Assembling the scene
      1. Replacing the building materials
      2. Tuning the lighting
    5. Creating the artwork rig
      1. Defining an artwork rig
      2. Adding a spotlight
      3. The exhibition plan
    6. Adding pictures to the gallery
    7. Managing art info data
      1. Using lists
      2. Using data structures
      3. Using scriptable objects
    8. Displaying the art info
    9. Adjusting for image aspect ratio
    10. Teleporting around the gallery
      1. Room-scale considerations
    11. Summary
  17. Using All 360 Degrees
    1. Technical requirements
    2. Exploring 360-degree media
      1. Understanding equirectangular projections
      2. VR is hacking your field of view
      3. Stereo 360-degree media
    3. Having fun with photo globes
      1. Seeing crystal balls
      2. Rendering globes
      3. Handling magic orbs
    4. Viewing 360-degree photos
      1. Viewing 360 images from the web
      2. Adding an image viewer UI
    5. Playing 360-degree videos
    6. Using Unity skyboxes
      1. Six-sided or cubemap skyboxes
      2. Spherical panoramic skyboxes
      3. 360-degree video skyboxes
    7. Capturing 360-degrees in Unity
      1. Capturing cubemaps and reflection probes
      2. Using third-party capture tools
    8. Summary
  18. Animation and VR Storytelling
    1. Technical requirements
    2. Composing our story
      1. Gathering the assets
      2. Creating the initial scene
    3. Timelines and Audio tracks
    4. Using a Timeline to activate objects
    5. Recording an Animation Track
      1. A growing tree
      2. A growing bird
    6. Using the Animation editor
      1. A wafting nest
    7. Animating other properties
      1. Animating lights
      2. Animating a scripted component property
    8. Using Animation clips
      1. Shaking an egg
    9. Using Animator Controllers
      1. ThirdPersonController Animator
      2. Living Birds Animator
      3. Defining the fly-to targets
      4. Using Animator hashes and DOTween to animate
      5. Using a Signal Track in Timeline
    10. Making the story interactive
      1. Look to play
      2. Resetting the initial scene's setup
    11. Summary
  19. Optimizing for Performance and Comfort
    1. Technical requirements
    2. Using the Unity Profiler and Stats windows
      1. The Stats window
      2. Overview of the Profiler window
      3. Analyzing and diagnosing performance problems
    3. Optimizing your art
      1. Decimating models
      2. Levels of detail
    4. Optimizing your scene with static objects
      1. Setting up the scene
      2. Lighting and baking
      3. Occlusion culling
    5. Optimizing the rendering pipeline
    6. Optimizing your code
      1. Understanding the Unity life cycle
      2. Writing efficient code
    7. Runtime performance and debugging
    8. Summary
  20. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.133.144.197