2024 Unity VR Tutorial (OpenXR and XR Interaction Toolkit) - PART 1 - Project Setup
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
📚 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.
🛠️ 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.
🖐️ 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.
🚀 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
💡LTS (Long Term Support)
💡URP (Universal Render Pipeline)
💡XR (Extended Reality)
💡XR Plugin Management
💡OpenXR
💡XR Interaction Toolkit
💡XR Hands
💡Materials Conversion
💡Hand Visualizer
💡Quest Link
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
[Music]
so let's get started with setting up the
first VR project in
unity before we start make sure you have
Unity installed on your system uh you
can install it through the website and
follow the
instructions from the website to get set
up once you have it installed and you
have the latest LTS version installed on
your
computer we can start creating the
project it's highly recommended that you
install the latest LTS
version so we click on new
project and then let's call
this
VR base
template we are creating a template now
that you can reuse and create projects
with this as the base so we'll call it
we are base template and set up a 3D
core
project keep in mind that this project
is going to be in urp
but I now going to set up a 3D core
project because I will be showing you
how to set up urp from scratch as
well let's create the
project
project is now set up and uh we will
start by first adding urp to our project
let's go to window package
manager and here in the top
left in the packages drop down we select
Unity
registry which means it will list all
the packages available to us from the
internet you can see the list here and
here in this list we find Universal
render pipeline so you can let's search
for
Universal the package is called
Universal RP and we will now install
it urp has now installed in our
project now the first thing we are going
to do with a urp project is we will have
to create the pipeline asset so the main
reason we are using urp is because it is
the most uh versatile render pipeline
available right now and uh it provides a
lot of crossplatform rendering
capabilities with our
projects so let's click on assets let's
right click in the assets folder and go
down here and find rendering so it's
right click create and we go down to the
rendering section and we select urp
asset with universal
renderer we can give this a name we can
just call this
urp
asset a urp asset is basically a file
that
defines a lot of uh rendering
settings for the project so if I click
on the urp asset on the right here you
will see the different settings that are
available to us we have quality we have
lighting we have the Shadows section and
also the postprocessing
section using these render pipeline
assets we get to create different
quality settings for our project so you
might have seen in most games where you
select the graphics quality low medium
high so we create those settings using
the urp
assets I will make another video
explaining this in detail but for now we
will just use the default
one once the asset is created we go to
edit project settings I'm sorry edit
project settings and then we go
to
Graphics so in the graphics section you
will see that the scriptable render
pipeline settings the pipeline asset is
empty so we click here and we add the
urp asset that we have just
created we have added the render
pipeline asset
now now our basic urp project is
ready we will now start with adding all
the XR packages that we need to make our
first XR Project work
let's go to
window let's go to package
manager let's clear that out and if I
scroll down you will see a few XR
packages here you will see XR plugin
management XR interaction toolkit and XR
hands these are the three main packages
that you will need to set up the base
project so the way we set up XR plug-in
management is let's close the package
manager we go to edit and project
settings
and on the left menu here at the bottom
we have the XR plug-in management
section let me click on that and you
will see the install XR plug-in
management button
here we'll click on
that
once
our project
opens we will
select we will open the project
settings and go to EXA plugin management
and install open open
XR once the open XR packages are
installed you will see a couple of
warnings here which we need to
resolve we will find these in the
project valid validation
section and for now we will be ignoring
the first
warning but if you look at the second
warning it says at least one interaction
profile must be
added please select which controllers
you will be testing against in the
features menu how we do that is we go to
the open XR Tab and you will see the
interaction profile section here and
here we will add the controllers that we
are going to be
using so I have an Oculus Quest 2 with
me or meta Quest
2 we will be adding three main
components and this works the same for
any meta headset that you might
have so I will add initially the Oculus
touch controller
profile I will add the meta Quest touch
Pro Controller
profile I will also add the hand
interaction
profile so these three profiles will
cover all of our use cases while
developing on a meta Quest
headset so now that we have added this
let me just close this and go to the
package manager because now we will be
adding the other XR packages that we
need to set up our base VR
project so in the package manager if you
look at the bottom above XR plug-in
management you have the XR interaction
toolkit so we will be installing
that
once that is
done which is almost about now we will
be adding the XR hands package as
well
so our project now
contains all the base packages needed to
develop full a full-fledged VR
application inside
Unity but to help us a little bit
further let's add some samples of these
packages so it's easier for us to
understand the packages better and also
perhaps reuse a lot of the components
available
there so let me click on XR interaction
toolkit and the samples Tab and we will
import the starter
assets we will also import the hands
interaction demo once this is
installed
we will now go to the XR hands package
and do the same in the sample section we
will import the hand
visualizer
sample and once we have that
imported we should be pretty
much done with all of our Imports for
now so the samples that we just imported
you will find in the sample section
here in the XR hands folder you will
find the hand
visualizer and in the XR interaction
toolkit you will
find the hand interaction demo
and
the XR interaction toolkit demo so this
is the hands interaction demo
here and you might see these materials
here that are a bit messed up which we
will just fix in a
second so and in the XR interaction
toolkit you
have the demo scene of the X our
interaction tool
gate so now you must have noticed that
the materials here are a bit off so if I
go to the hand visualizer scene
especially you will see that the hands
have a pinkish material so this
basically means that the material cannot
be
rendered by the urp renderer because
most of these materials in the package
come as so in order to fix that
it's a very simple solution we go to the
assets
folder next to the search bar you will
find a search by type button let's click
on that and select all the
materials and in this folder you will
see the list of materials that we will
need to convert into urp which can be
identified by this pinkish color that we
see here so let's select all of them and
conver them to
urp so holding control you can multi-
select them and I'll go to
edit rendering materials and con convert
selected built-in materials to
urp so let's do proceed and as soon as I
do that you will see that all the
materials are
fixed there is one very important step
that needs to be done after importing
our hand XR hands package uh without
which the hand tracking will not work
and that is we have to go to
edit we go to Project settings and we
have to enable the hand tracking
subsystem and the Hand interaction
poses feature
groups uh please keep in mind that this
is very important otherwise the hand
tracking will not
work so let me close that
up and now we can start testing our
scenes so let's test out the hand
visualizer scene
first before we enter play mode in unity
uh there is a quick step that we we need
to do in our headset so with the headset
connected over USB we enter the menu and
we select Quest
link once we open Quest link it shows us
the connected uh PC and then we enter
the quest link so this is the
environment that we need to be in in
order to play external applications uh
in this case our Unity
scene
so that is our hand visualizer scene
now we will also go to the samples and
test out the interaction toolkit
scenes so it's called hands demo scene
where we can test out the interactions
of
the hands
package
similarly we can also take a look at the
starter assets of the XR interaction
toolkit and these are all controller
based
interactions
excellent our base project is now ready
and we are ready to start developing VR
applications in the next video we will
take a look at the different types of VR
characters or rigs that are available to
us by the open XR package we will also
learn how to set up a fully functional
character from from scratch by
ourselves if this video helped you out
please don't forget to like And
subscribe for more share this video with
a friend if you think it's going to help
them out if you have any questions drop
them in the comments below and I will
see you in the next
one
Посмотреть больше похожих видео
5.0 / 5 (0 votes)