If you’ve played 360 video in VR, you know it’s kinda cool… But lately, 3D video is starting to take off. With off the shelf cameras like the Vuze line, it’s gotten easy to record your own without spending the cost of a new car to get started.. Before today, playing 360 3D video in VR with Unity3D was a bit complicated.. but now, thanks to an open source project put out by Unity Technologies, it’s getting easier. Earlier today, I stumbled on a post and github project they’ve put together to make 3D 360 video simple to implement.
Video Version
Project Setup
To get going, you’ll need a couple things.. First, you need a 3D video. For this article, I’m using a Side-By-Side video you can download from here: https://www.youtube.com/watch?v=UsC6PxAwKNI
If you’re not sure how to download videos from youtube.. I’ve recently started using 4K Video Downloader and love it.. it’s free and seems to have no adware..
Once you’ve downloaded your video, you’ll need to grab the script and shader from this github project: https://github.com/Unity-Technologies/SkyboxPanoramicShader
You can download it or clone the repository, whatever you feel most comfortable doing.
Place the shader and script into your project along with the video file you want to play.
You’ll also need to visit your player settings and make sure the Virtual Reality Enabled box is checked.
Render Texture
To use this shader, we need a render texture. Create a new render texture and name it “Panoramic Render Texture”
Select the RenderTexture and change the size to 4096×4096.
Change the depth buffer to “No depth buffer”.
Render textures are textures that can be rendered to. They can be used to implement image based rendering effects, dynamic shadows, projectors, reflections or surveillance cameras.
The Video Player
To create a video player, drag the video from the project view into the scene view. A player will automatically be created with the video assigned to it.
Select the video player and look to the inspector.
Change the render mode to “Render Texture”.
Drag the render texture from the project view into the target texture field.
The Material
Next, we need to create a material for the shader.
Create a new material, name it “Skybox”
Drag the render texture onto it.
Set the mapping type to “Latitude Longitude Layout”
Change the image type to 180 Degrees (this video is 180).
Set the 3D layout to “Side by Side”
Skybox Setup
The last step is to assign our material to the skybox.
Open the Lighting window.
Drag the Skybox into the Skybox Material field.
All Done
That’s it, save your scene…
Then put on the headset and press play, the video should start playing in 3D.
What about other video types?
This shader appears to have support for a few different video formats. In this article, we covered a simple 180 degree side by side video, but you may have noticed the options for 360 & over under. I haven’t tried those yet, but if you’re interested in them, I’d recommend you check out the full documentation they’ve provided here: https://docs.google.com/document/d/1JjOQ0dXTYPFwg6eSOlIAdqyPo6QMLqh-PETwxf8ZVD8/edit#








