UNITY VR video/Photo development experience (II)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.