2024 Unity VR Tutorial (OpenXR and XR Interaction Toolkit) - PART 1 - Project Setup

SVRGATech
2 Apr 202416:49

Summary

TLDRThis video tutorial guides viewers through setting up a VR project in Unity using the latest LTS version. It covers creating a 3D core project, installing the Universal Render Pipeline (URP), and configuring it with a URP asset. The video also details adding XR packages like XR Plugin Management, XR Interaction Toolkit, and XR Hands, and resolving setup warnings. It includes importing sample assets for better understanding and concludes with enabling hand tracking and testing scenes in Unity. The tutorial sets a foundation for developing VR applications and hints at future lessons on VR character rigs.

Takeaways

  • 💻 Install Unity with the latest LTS version for optimal VR project setup.
  • 🔨 Create a new 3D core project named 'VR base template' to use as a reusable foundation.
  • 🛠️ Set up URP (Universal Render Pipeline) from scratch for versatile and cross-platform rendering capabilities.
  • 🔍 Install the XR (Cross-Reality) packages: XR Plugin Management, XR Interaction Toolkit, and XR Hands for a comprehensive VR development environment.
  • 🎛️ Configure the XR Plugin Management to install OpenXR and set up interaction profiles for supported controllers.
  • 📦 Import XR interaction toolkit samples and XR hands interaction demo for practical examples and reusable components.
  • 🖌️ Convert materials from the package to URP-compatible versions to ensure proper rendering.
  • 👐 Enable hand tracking and interaction features in Unity's Project Settings to support hand-based interactions.
  • 📱 Use Quest Link to connect and test Unity scenes on a Meta Quest 2 headset for real-time VR experience.
  • 🚀 Prepare to explore different types of VR characters and rigs in the next tutorial for advanced VR application development.

Q & A

  • What is the first step to set up a VR project in Unity?

    -The first step is to ensure Unity is installed on your system, preferably the latest LTS version, and then create a new project.

  • Why is it recommended to use the latest LTS version of Unity for VR projects?

    -The latest LTS (Long Term Support) version is recommended because it provides stability and support for a longer period, which is beneficial for long-term VR project development.

  • What does URP stand for and why is it used in the project?

    -URP stands for Universal Render Pipeline. It is used because it is versatile and provides cross-platform rendering capabilities, making it suitable for VR projects.

  • How do you add URP to a Unity project?

    -You add URP to a Unity project by going to the Package Manager, selecting Unity Registry, searching for 'Universal RP', and then installing it.

  • What is a URP asset and why is it important?

    -A URP asset is a file that defines rendering settings for a project, including quality, lighting, shadows, and post-processing. It's important for creating different quality settings for various platforms.

  • How do you set up the XR (Cross-Reality) packages for a Unity VR project?

    -You set up the XR packages by going to the Package Manager and installing XR Plugin Management, XR Interaction Toolkit, and XR Hands. After installing, you configure them in the Project Settings.

  • Why is it necessary to install the XR Interaction Toolkit and XR Hands packages?

    -These packages provide essential tools and components for creating interactive VR experiences, including hand tracking and controller interactions.

  • What additional components are needed for hand tracking to work in a Unity VR project?

    -After importing the XR Hands package, you need to enable the Hand Tracking subsystem and Hand Interaction Poses feature groups in the Project Settings.

  • How can you fix materials that cannot be rendered by the URP renderer?

    -You can fix materials that are not compatible with URP by selecting them in the Assets folder and converting them to URP using the 'Edit > Rendering > Materials > Convert Selected Built-in Materials to URP' option.

  • What is the purpose of importing samples from the XR Interaction Toolkit and XR Hands packages?

    -Importing samples helps to understand the packages better and provides reusable components for developing VR interactions and hand visualizations.

  • How do you test a Unity VR scene on a Meta Quest headset?

    -To test a Unity VR scene on a Meta Quest headset, connect the headset via USB, use Quest Link to connect to the PC, and then enter the VR environment to play the Unity scene.

Outlines

00:00

📚 Setting Up Unity for VR Development

The video script begins with instructions on setting up Unity for a VR project. It emphasizes the importance of installing the latest LTS version of Unity from the official website. Once Unity is installed, the viewer is guided to create a new project named 'VR base template', which will serve as a reusable template for future projects. The project is set up as a 3D core project with URP (Universal Render Pipeline). The script then walks through the process of installing URP from the Unity Registry and creating a URP asset, which is crucial for defining rendering settings in the project. The asset is then applied to the project settings to finalize the basic URP project setup.

05:00

🛠️ Installing XR Packages for VR

The second paragraph focuses on adding XR (Extended Reality) packages necessary for VR development in Unity. It details the process of installing three main packages: XR Plugin Management, XR Interaction Toolkit, and XR Hands. The script explains how to access and install these packages through the Package Manager and Project Settings. After installing the packages, it addresses the need to resolve warnings, particularly setting up interaction profiles for the controllers that will be used for testing. The viewer is shown how to add Oculus Touch Controller, Meta Quest Touch Pro Controller, and Hand Interaction profiles. The paragraph concludes with the installation of additional XR packages and the import of sample assets to facilitate understanding and reuse of components.

10:06

🖐️ Importing and Testing VR Interaction Samples

This paragraph delves into importing and testing VR interaction samples within Unity. It covers the process of importing the Hand Visualizer sample and the Hands Interaction Demo from the XR Hands package and the XR Interaction Toolkit, respectively. The script highlights the need to fix materials that are not compatible with URP by converting them. It also emphasizes the critical step of enabling the Hand Tracking subsystem and Hand Interaction poses feature groups in the Project Settings to ensure hand tracking functionality. The viewer is guided through testing the scenes in Unity, including the Hand Visualizer scene and the Hands Demo scene, to verify the interactions and setup.

15:10

🚀 Preparing for VR Application Development

The final paragraph of the script sets the stage for the next phase of VR application development. It mentions an upcoming video that will explore different types of VR characters or rigs available through the Open XR package and how to set up a fully functional character from scratch. The script concludes with a call to action for viewers to like, subscribe, and share the video, and to leave comments with any questions. It provides a summary of the progress made so far, with the base project now ready for further development.

Mindmap

Keywords

💡Unity

Unity is a powerful game engine used for creating 2D, 3D, virtual reality (VR), and augmented reality (AR) games and experiences. In the video, Unity is the primary software used to set up a VR project, highlighting its capability to handle complex rendering tasks and serve as a platform for VR development.

💡LTS (Long Term Support)

LTS refers to a version of software that receives updates and support for an extended period, ensuring stability and compatibility. The video recommends installing the latest LTS version of Unity to ensure that the VR project has the most reliable and up-to-date features available.

💡URP (Universal Render Pipeline)

URP is a render pipeline in Unity that provides a versatile and high-performance rendering solution for creating games and applications. The video script mentions installing URP and creating a URP asset, which are essential steps for setting up a VR project with optimized rendering capabilities.

💡XR (Extended Reality)

XR is an umbrella term for all real-time immersive technologies, including VR, AR, and mixed reality (MR). The video discusses adding XR packages to the Unity project, indicating the use of XR technologies to enhance the VR experience.

💡XR Plugin Management

XR Plugin Management is a Unity package that simplifies the integration of XR SDKs and plugins. The video script describes installing this package to manage different XR SDKs, which is crucial for supporting various VR hardware in the project.

💡OpenXR

OpenXR is an open standard for accessing AR and VR devices. The video mentions installing OpenXR through the XR Plugin Management, which allows the Unity project to interface with a wide range of VR hardware, ensuring broader compatibility.

💡XR Interaction Toolkit

The XR Interaction Toolkit is a Unity package that provides a set of components and samples for building interactive XR experiences. The video script includes adding this package to the project, which is essential for creating intuitive and engaging VR interactions.

💡XR Hands

XR Hands refers to a Unity package that enables hand tracking and interaction in XR applications. The video script details the installation of this package and the importance of enabling hand tracking features in the project settings, which is key for natural and immersive VR experiences.

💡Materials Conversion

Materials Conversion in Unity involves changing the material settings of objects to be compatible with different rendering pipelines, such as URP. The video script mentions converting materials to URP, which is necessary to ensure that the materials render correctly in the VR project.

💡Hand Visualizer

The Hand Visualizer is a sample from the XR Hands package that demonstrates hand tracking and visualization in Unity. The video script describes importing and testing the Hand Visualizer scene, which is an essential step in verifying the functionality of hand tracking in the VR project.

💡Quest Link

Quest Link is a feature that allows Oculus Quest devices to connect to a PC and run PC VR applications. The video script instructs the viewer to use Quest Link to test the Unity VR project on an Oculus Quest 2 headset, illustrating the practical application of the project setup.

Highlights

Introduction to setting up the first VR project in Unity.

Requirement to have Unity installed with the latest LTS version.

Creating a new project called 'VR base template'.

Explanation of using URP (Universal Render Pipeline) for its versatility and cross-platform capabilities.

Installation of the Universal RP package from Unity Registry.

Creation of a URP Asset for rendering settings.

Adding the URP Asset to the Graphics settings in Project Settings.

Introduction to XR packages necessary for VR development.

Installation of XR Plugin Management and setting up OpenXR.

Resolving warnings by adding interaction profiles for controller support.

Installation of XR Interaction Toolkit for interaction design.

Importing samples for better understanding and reusability of components.

Fixing materials to be compatible with URP by converting them.

Enabling hand tracking subsystem and hand interaction poses feature groups.

Testing the hand visualizer scene and setup for play mode in Unity.

Exploring the XR interaction toolkit scenes for interaction testing.

Teaser for the next video on VR character rigs and setting up a functional character.

Call to action for likes, subscriptions, and sharing the video.

Transcripts

play00:00

[Music]

play00:04

so let's get started with setting up the

play00:06

first VR project in

play00:09

unity before we start make sure you have

play00:12

Unity installed on your system uh you

play00:15

can install it through the website and

play00:17

follow the

play00:20

instructions from the website to get set

play00:23

up once you have it installed and you

play00:26

have the latest LTS version installed on

play00:29

your

play00:30

computer we can start creating the

play00:33

project it's highly recommended that you

play00:35

install the latest LTS

play00:40

version so we click on new

play00:44

project and then let's call

play00:47

this

play00:52

VR base

play00:58

template we are creating a template now

play01:00

that you can reuse and create projects

play01:05

with this as the base so we'll call it

play01:07

we are base template and set up a 3D

play01:09

core

play01:10

project keep in mind that this project

play01:13

is going to be in urp

play01:15

but I now going to set up a 3D core

play01:17

project because I will be showing you

play01:19

how to set up urp from scratch as

play01:22

well let's create the

play01:28

project

play01:33

project is now set up and uh we will

play01:37

start by first adding urp to our project

play01:40

let's go to window package

play01:44

manager and here in the top

play01:46

left in the packages drop down we select

play01:49

Unity

play01:51

registry which means it will list all

play01:53

the packages available to us from the

play01:58

internet you can see the list here and

play02:00

here in this list we find Universal

play02:02

render pipeline so you can let's search

play02:05

for

play02:13

Universal the package is called

play02:15

Universal RP and we will now install

play02:23

it urp has now installed in our

play02:28

project now the first thing we are going

play02:31

to do with a urp project is we will have

play02:33

to create the pipeline asset so the main

play02:36

reason we are using urp is because it is

play02:39

the most uh versatile render pipeline

play02:41

available right now and uh it provides a

play02:44

lot of crossplatform rendering

play02:47

capabilities with our

play02:51

projects so let's click on assets let's

play02:54

right click in the assets folder and go

play02:57

down here and find rendering so it's

play03:00

right click create and we go down to the

play03:03

rendering section and we select urp

play03:07

asset with universal

play03:08

renderer we can give this a name we can

play03:11

just call this

play03:14

urp

play03:18

asset a urp asset is basically a file

play03:23

that

play03:24

defines a lot of uh rendering

play03:27

settings for the project so if I click

play03:30

on the urp asset on the right here you

play03:33

will see the different settings that are

play03:36

available to us we have quality we have

play03:38

lighting we have the Shadows section and

play03:40

also the postprocessing

play03:44

section using these render pipeline

play03:47

assets we get to create different

play03:49

quality settings for our project so you

play03:51

might have seen in most games where you

play03:53

select the graphics quality low medium

play03:57

high so we create those settings using

play04:00

the urp

play04:02

assets I will make another video

play04:04

explaining this in detail but for now we

play04:06

will just use the default

play04:09

one once the asset is created we go to

play04:12

edit project settings I'm sorry edit

play04:16

project settings and then we go

play04:19

to

play04:21

Graphics so in the graphics section you

play04:24

will see that the scriptable render

play04:26

pipeline settings the pipeline asset is

play04:28

empty so we click here and we add the

play04:31

urp asset that we have just

play04:40

created we have added the render

play04:42

pipeline asset

play04:45

now now our basic urp project is

play04:48

ready we will now start with adding all

play04:52

the XR packages that we need to make our

play04:56

first XR Project work

play05:00

let's go to

play05:01

window let's go to package

play05:04

manager let's clear that out and if I

play05:08

scroll down you will see a few XR

play05:10

packages here you will see XR plugin

play05:12

management XR interaction toolkit and XR

play05:15

hands these are the three main packages

play05:19

that you will need to set up the base

play05:22

project so the way we set up XR plug-in

play05:24

management is let's close the package

play05:26

manager we go to edit and project

play05:29

settings

play05:31

and on the left menu here at the bottom

play05:34

we have the XR plug-in management

play05:37

section let me click on that and you

play05:39

will see the install XR plug-in

play05:41

management button

play05:44

here we'll click on

play05:58

that

play06:13

once

play06:14

our project

play06:17

opens we will

play06:21

select we will open the project

play06:25

settings and go to EXA plugin management

play06:28

and install open open

play06:33

XR once the open XR packages are

play06:37

installed you will see a couple of

play06:39

warnings here which we need to

play06:41

resolve we will find these in the

play06:43

project valid validation

play06:46

section and for now we will be ignoring

play06:48

the first

play06:50

warning but if you look at the second

play06:52

warning it says at least one interaction

play06:54

profile must be

play06:56

added please select which controllers

play06:59

you will be testing against in the

play07:01

features menu how we do that is we go to

play07:04

the open XR Tab and you will see the

play07:07

interaction profile section here and

play07:10

here we will add the controllers that we

play07:12

are going to be

play07:14

using so I have an Oculus Quest 2 with

play07:18

me or meta Quest

play07:20

2 we will be adding three main

play07:23

components and this works the same for

play07:25

any meta headset that you might

play07:28

have so I will add initially the Oculus

play07:31

touch controller

play07:33

profile I will add the meta Quest touch

play07:35

Pro Controller

play07:37

profile I will also add the hand

play07:40

interaction

play07:42

profile so these three profiles will

play07:45

cover all of our use cases while

play07:48

developing on a meta Quest

play07:52

headset so now that we have added this

play07:54

let me just close this and go to the

play07:58

package manager because now we will be

play08:01

adding the other XR packages that we

play08:04

need to set up our base VR

play08:07

project so in the package manager if you

play08:09

look at the bottom above XR plug-in

play08:12

management you have the XR interaction

play08:15

toolkit so we will be installing

play08:28

that

play08:41

once that is

play08:44

done which is almost about now we will

play08:47

be adding the XR hands package as

play08:58

well

play09:09

so our project now

play09:11

contains all the base packages needed to

play09:15

develop full a full-fledged VR

play09:17

application inside

play09:19

Unity but to help us a little bit

play09:21

further let's add some samples of these

play09:25

packages so it's easier for us to

play09:27

understand the packages better and also

play09:30

perhaps reuse a lot of the components

play09:32

available

play09:33

there so let me click on XR interaction

play09:36

toolkit and the samples Tab and we will

play09:40

import the starter

play09:42

assets we will also import the hands

play09:46

interaction demo once this is

play09:58

installed

play10:06

we will now go to the XR hands package

play10:08

and do the same in the sample section we

play10:11

will import the hand

play10:15

visualizer

play10:24

sample and once we have that

play10:28

imported we should be pretty

play10:31

much done with all of our Imports for

play10:36

now so the samples that we just imported

play10:39

you will find in the sample section

play10:43

here in the XR hands folder you will

play10:47

find the hand

play10:52

visualizer and in the XR interaction

play10:56

toolkit you will

play10:58

find the hand interaction demo

play11:02

and

play11:03

the XR interaction toolkit demo so this

play11:07

is the hands interaction demo

play11:13

here and you might see these materials

play11:15

here that are a bit messed up which we

play11:17

will just fix in a

play11:21

second so and in the XR interaction

play11:24

toolkit you

play11:26

have the demo scene of the X our

play11:29

interaction tool

play11:31

gate so now you must have noticed that

play11:35

the materials here are a bit off so if I

play11:39

go to the hand visualizer scene

play11:41

especially you will see that the hands

play11:43

have a pinkish material so this

play11:45

basically means that the material cannot

play11:48

be

play11:50

rendered by the urp renderer because

play11:53

most of these materials in the package

play11:56

come as so in order to fix that

play12:00

it's a very simple solution we go to the

play12:02

assets

play12:03

folder next to the search bar you will

play12:05

find a search by type button let's click

play12:07

on that and select all the

play12:11

materials and in this folder you will

play12:14

see the list of materials that we will

play12:17

need to convert into urp which can be

play12:21

identified by this pinkish color that we

play12:24

see here so let's select all of them and

play12:28

conver them to

play12:40

urp so holding control you can multi-

play12:43

select them and I'll go to

play12:46

edit rendering materials and con convert

play12:50

selected built-in materials to

play12:58

urp so let's do proceed and as soon as I

play13:02

do that you will see that all the

play13:05

materials are

play13:09

fixed there is one very important step

play13:12

that needs to be done after importing

play13:14

our hand XR hands package uh without

play13:18

which the hand tracking will not work

play13:20

and that is we have to go to

play13:23

edit we go to Project settings and we

play13:26

have to enable the hand tracking

play13:31

subsystem and the Hand interaction

play13:35

poses feature

play13:37

groups uh please keep in mind that this

play13:40

is very important otherwise the hand

play13:42

tracking will not

play13:43

work so let me close that

play13:48

up and now we can start testing our

play13:50

scenes so let's test out the hand

play13:52

visualizer scene

play13:54

first before we enter play mode in unity

play13:57

uh there is a quick step that we we need

play13:59

to do in our headset so with the headset

play14:01

connected over USB we enter the menu and

play14:05

we select Quest

play14:07

link once we open Quest link it shows us

play14:10

the connected uh PC and then we enter

play14:13

the quest link so this is the

play14:16

environment that we need to be in in

play14:17

order to play external applications uh

play14:21

in this case our Unity

play14:28

scene

play14:56

so that is our hand visualizer scene

play15:01

now we will also go to the samples and

play15:04

test out the interaction toolkit

play15:10

scenes so it's called hands demo scene

play15:13

where we can test out the interactions

play15:16

of

play15:17

the hands

play15:27

package

play15:46

similarly we can also take a look at the

play15:49

starter assets of the XR interaction

play15:53

toolkit and these are all controller

play15:56

based

play15:57

interactions

play16:12

excellent our base project is now ready

play16:14

and we are ready to start developing VR

play16:16

applications in the next video we will

play16:18

take a look at the different types of VR

play16:20

characters or rigs that are available to

play16:22

us by the open XR package we will also

play16:26

learn how to set up a fully functional

play16:28

character from from scratch by

play16:30

ourselves if this video helped you out

play16:32

please don't forget to like And

play16:34

subscribe for more share this video with

play16:37

a friend if you think it's going to help

play16:38

them out if you have any questions drop

play16:41

them in the comments below and I will

play16:43

see you in the next

play16:48

one

Rate This

5.0 / 5 (0 votes)

Связанные теги
VR DevelopmentUnity TutorialURP SetupXR PackagesOculus QuestMeta QuestHand TrackingVR InteractionRendering Pipeline3D Project
Вам нужно краткое изложение на английском?