360 video are also known as spherical video which records a view in every direction at same time. Unlike normal video 360 video gives you complete 360- angle view. While watching these video you can control viewing direction. These are recorded by special rig cameras, or using a dedicated 360 camera that contains multiple camera lenses added into the device.
Since new video component is added in unity it is possible to add 360 video. Si today in this tutorial, I will show you how to do Integrate 360 Video in Unity, for that first we need following Assets:
Unity3d (5.6 or higher) - cross platform game editor we are using this for setup our scene
360 video - we also need 360 video which we want to integrate
Android phone - for test our video
Step 1 - Create scene
The concept of 360 video is straightforward in unity we need rectangular frame for normal video and sphere frame for 360 video.
First add a sphere object in scene, and put its position in center (0,0,0) scale radius (60,60,60).
Also set camera position to (0,0,0) which is position of your player.
Now run your scene and you can see that nothing going on because most game engine (unity) not allow to render inner side of object
camera inside sphere
Step 2 - Add shader
To render object form inside we need to add shader that will apply on sphere’s Material. In unity this process called reversing normal.
Create Material folder inside Assets and add one Material
Assets> Create> Material
Create Shader folder and add NewSurfaceShader to it
Shader> Create> Shader> NewSurfaceShader
Now open NewSurfaceShader in editor and Replace the existing code/content with following code: