VR Tutorial

A comprehensive guide on how you can start developing VR applications for Meta Quest VR devices

Introduction

A mesh is a collection of data that describes a shape. This collection of data usually includes vertices, edges, and faces that define the shape of a 3D object. In Unity meshes are used in graphics as well as physics. 

In graphics, you use meshes together with Materials. To simplify the concept, Meshes describe the shape of the object that the GPU will render, while Materials describe the appearance of its surface. 

In physics, meshes are used to determine the shape of a collider.

Meshes can be created in 3 ways: you can create the mesh as part of a 3D modeling program, such as blender, and then import it, create a mesh directly with in-editor tools in Unity, or create meshes with code. If assets were imported through the Unity Asset Store, meshes should be included.

Materials work closely together with Shaders. You must always use materials with shaders. Shaders are bit beyond the scope of this tutorial, however additional information can be found here: Shader.

Mesh Renderer Component

Once you have a Mesh for a GameObject, you will also need a component known as the Mesh Renderer in order to render it. The Mesh Renderer works with a Mesh Filter component on the GameObject. In our project each one of our GameObjects have Meshes. These were included with the package of the asset that was imported from the Unity Asset Store

To use an example, the table in our project came in an asset package: Low Poly Office Props - Lite.

You can see that these assets came with their own meshes, which you can check by referencing the Inspector window.

 

You can also verify through Project Window.

 

Checking the entire Inspector window for this table model, you can see at the very bottom that the Material is also used along with a shader.

 

Various directories for all Meshes and Materials should be included with the asset package. Additional information regarding all of the options for the Mesh Renderer component can be found here: Mesh Renderer