On the back of the general Panorama picture, this time to talk about real VR.
Since this picture is divided into two parts, we need two camera objects and two spheres. First create a new camera object and name it Righteye (other names are OK, as long as you know for yourself), name the original camera Lefteye, create a new two balls, and name left and right. Set the position of the left camera and the left ball to be the same, and the right camera and the right ball are also set to the same position, but the position of the two balls cannot coincide. Note that the rotate of two balls must be consistent! Two camera rotate also must be consistent!
The next operation is more important, we sit steady.
Select the Edit menu to select Project Setting select tags and layers, expand layers, type left and right (if it is an empty project, typically user Layer8 and 9 if the 8,9 is taken up) in two spaces. Then respectively, the left and right sphere layer is set to left and right, and then respectively, the camera's cuilling mask to leave and right (first select Nothing, then select left or right, not one point). Finally, the target eye of the camera is set to left and right respectively. When the above operation is complete, the left camera only displays the contents of the left sphere, and the right camera is the same.
Because the picture is divided into the upper and lower part of the left eye only need to the upper half, the right eye only need the lower half, so we have to find a way to the left eye of the lower part, the right eye the same. Unity's material martial has two properties to do the above, respectively, the tiling and offset,tiling properties are the size of the value material in the object, and the value of 0-1,offset is the offset. First create a new two martial, named Leftmat and Rightmat,shader respectively, select Unitl/texture,tiling.y are set to 0.5, Rightmat is set to 0.5. Import the picture and select the two martial texture as the picture.
Done! Try to install it on your big phone!
UNITY VR video/Photo development experience (II)