Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
936 views
in Technique[技术] by (71.8m points)

unity3d - Unity- Photosphere Photo Viewer for Google Cardboard

I am trying to build a Photosphere-like application with Unity3D and use it along with Google cardboard.

I need to load different panoramic view photos and be able to view them stereoscopically, by using the Cardboard goggles.

I am having problem to use the pano images and render it into stereoscopic view in Unity.

Any suggestions will be gratefully received.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Simplest solution that I can give to you:

A. Install your Unity Pro with Android Pro plugins, setup Cardboard SDK For Unity, install Android Build tools and SDK.

B Setup Skybox

  1. Get a stereoscopic panorama image (Might take a while to load the image as it is a high resolution image).

  2. In Unity, import the image, change the Texture Type to Cubemap. Select the Mapping as Cylindrical (Lat and Long).

  3. Create a Material, change the Shader to Skybox/Cubemap.

  4. Assign the texture to the material.

  5. In Unity 5 Pro topbar, select Window -> Ligthing, drag the material to the Skybox property. In this step you can do it programmatically. Combine these steps with the Cardboard assets and game objects. Voila, you've made a VR panorama stereoscopic Cardboard app! The whole setup is just take out your five minutes(excluding setup your tools :D).

If you're familiar with Unity, you know exactly what to do on my instructions. If you stuck at somewhere in my steps, feel free to ask me. Happy coding :)

Extra tips: You can make the large textures files into Asset Bundles, act like a dynamic content which is stored in the server. Your app is just simply a small-size empty app. When app launches, request and download the asset bundles from server then manipulate the textures. :)

Super extra tip: Don't forget to generate asset bundles under Android Build Settings. If not, your textures will be corrupted when the bundle is downloaded to Android phones.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...