This little Shader is going to turn each pixel of the sphere inside out. We need to write custom code for the Shader… but have no fear, you can copy-paste the code below: Hence create a new Material for the Sphere, then a new Shader applied to this Material. Shaders are small scripts that calculate the color of each pixel rendered, based on lighting and information pulled from their Materials. Materials control the appearance of objects in Unity. We’ll use a program called a Shader, that we’ll apply to the Material of the Sphere. In 3D geometry, we call this transformation « reversing normals » or « flipping normals ». For that reason, we are going to make a program to flip these little facets like pancakes. The external sides of the facets are visible, but not the internal ones. In Unity, spheres are not actually spheres (what? We’ve been lied to all along!), they are polygons made with thousands of teeny, tiny facets. That’s the whole point of the app, so we are going to turn it inside-out. In our case, we do need to see our Sphere from the inside.
This is because we rarely need to see them, it would be a waste of resource to render them.
Don’t worry, there is an explanation for that! Indeed, most game engines do not, by default, render by default the inner side of 3D objects. Once the Camera is placed inside the Sphere, the latter is no longer visible in the Scene. Placing it elsewhere would make the video look distorted. The Camera is the player/viewer’s eyes so we want it at the center of the Sphere. The Camera’s position should also be set to 0, 0, 0. For step-by-step instructions, refer to the video Step 1: Build a Sphere ?įirst, let’s open a new Unity Project if you are starting from scratch (or a new Scene if you want to integrate the 360 video player in an existing project.) Think of a Scene as one level of a video game, and a Project as a full game.Īfterwards, add a sphere object in the Scene, placed at its center ( Position = 0, 0, 0), with a radius of 50 ( Scale = 50, 50, 50). The steps below should make you feel empowered to make your own changes, by explaining how it all works under the hood. The player (or viewer) will be located inside this sphere and will be able to watch the video in any direction. So, we first need to create a spherical screen to project our 360 video onto. Unlike regular video that has a rectangular frame, 360 video has the shape of a sphere. Shoot one with a 360 camera (h ere’s one you can plug into your phone) or find one online. ? The G oogleVR SDK for Unity, which you can download beforehand. We will use this software to build our whole project. ? U nit圓D, a cross-platform game engine, that you need to install on your computer, version 5.6 or newer.
If you don’t own one, you can find many on Amazon for less than 10 dollars. ? An A ndroid phone with a gyroscope to sense head movements, running on KitKat or newer OS. VR development should not be a barrier to bringing your ideas to life. This tutorial will show you how to build a 360 video app on Android and Google Cardboard in just a few minutes. Yet making VR is perceived as intimidating: it’s expensive and requires both special hardware and skills.īut that’s changing, as intuitive tools and affordable hardware are making VR development accessible. VR is poised to give birth to new forms of storytelling and emotionally powerful experiences. It’s also the New Frontier of app development. By Adriana Vecchioli Here’s how you can make a 360 VR app in 10 minutes with Unity Image credits: yours truly