Overview
Creating 360 videos on existing objects are easily created using 360 capture devices. In this tutorial I use the same methodology but with virtual 3D models and environments.
This sample makes use of a Revit model of a villa in Spain that was created for a client, then we export to Unity and create a 360 recording of every frame to produce a 360 video that can be post-processed for Youtube 360 videos that supports VR at 4K resolution and high frame rates.
Solution(s)
In this sample, Revit was used to create the model geometry. I suggest using multiple layers for Walls and Floors, this will enable you to apply different materials to inside- and outside faces once in Unity.
Once exported from Revit as FBX files, import into Unity and apply materials to objects. Note the 3 layers of the Wall in the image below, this is a result of the layering used in Revit as per the above image:
I copied the Revit Material Library to another location on my machine and then manually created the Unity materials from the required Revit materials.
The next step is to add a 360 photosphere of the surrounding area. In this example I had someone go to the actual site and take a 360 photosphere with an Android phone. I then used the 360 photo to apply to a 360 Skybox in Unity. There are many onnline tutorials on how to achieve this (https://www.google.co.nz/search?q=create+unity+skybox+from+photosphere&oq=create+unity+skybox+from+photosphere&aqs=chrome..69i57.6843j0j7&sourceid=chrome&ie=UTF-8).
After positioning my FBX model that was exported from Revit, I then proceed to create an animation for my camera. Be sure to provide enough time for viewers to be able to appreciate the environment and to experience the model. The camera path was set up as follow in Unity (your animation sequence would be different to mine):
Now that the camera path has been set up, I added the Panorama Capture script (refer to references at the bottom of this article):
The script start capturing images once the Unity Player starts. I have customised the script slightly to place the captured images into a sub-folder for better management. In my 4 minutes and 12 seconds animation, I managed to capture thousands of images.
Once the animation has completed, the images needs to be compiled into a video. This is done by using FFMPEG which is a free tool for video creation from images among other features (link at the bottom of this article).
I used the instructions from the Readme.txt file that comes with the Panorama Capture tool to compile the 360 video sequence from FFMPEG.
The resulting video then needs to be prepared for Youtube which requires an injector tool before uploading to Youtube, which can be found at the bottom of this article. The Youtube 360 video supports 3D model viewing and VR (if a VR compatible device is detected):
Optional: I added some standard rendering scripts to my camera in Unity to improve the realism of the renders as follow:
Note(s)
I used the following software, assets and scripts for this sample:
- Revit 2019
- Unity 2017.3.1f1
- Unity Script: 360 Panorama Capture (1.3) from https://github.com/eVRydayVR/Unity360PanoramaCapture
- FFMPEG: https://www.ffmpeg.org/
- Spatial Media Injector: https://github.com/google/spatial-media/releases
Conclusion
By using this workflow you should be able to produce high quality and smooth 360 VR videos that are compatible on multiple platforms requiring minimum resources. The walkthrough is a guided and automated path which cannot be controlled by the viewer, but the advantage of this workflow is that any user with a fairly modern mobile device can view this VR model in high definition and without lag. Internet connection speed will however impact the overall experience.
Please leave a comment or post a question if you liked this tutorial or would like to find out more on this workflow.