VR View - Render: Unable to load Texture from image.jpg
Asked Answered
A

2

7

Ive been trying to get a VR View setup on my page following the examples and such at https://developers.google.com/vr/concepts/vrview, the image i'm using is a cardboard camera 'photo' copied from my device, but i've also used a regular jpg version just to be sure.

No matter what i try when the widget loads it only ever shows the error message

Render: Unable to load Texture from image.jpg

I've also noticed a bunch of tutorial or example site having the same issue that i assume they didn't have when they first posted the pages.

Does anyone have a clue why its doing this and how to fix it?

Autonomous answered 27/5, 2016 at 3:30 Comment(0)
S
6

The image that is produced by Cardboard Camera is not in the correct format. VR view requires a equirectangular-panoramic image, and for stereo images, they need to be stacked. See https://developers.google.com/vr/concepts/vrview#supported_formats for Reference.

There is a link to convert Cardboard Camera images to the correct format: https://storage.googleapis.com/cardboard-camera-converter/index.html

There are also a couple codelabs that walk through using VR view, including converting the image to the correct format: https://codelabs.developers.google.com/?cat=Virtual+Reality

Spousal answered 27/5, 2016 at 17:5 Comment(1)
Well that didn't completely solve the issue but it did send me down the right path so ill accept it as the answer. Converting the image alone wasn't enough, but after looking over the codelab i decided to simply clone the vrview repo and store the code locally instead of using the public one, as soon as i did this the converted image started working. save yourself some time people and just close the repoAutonomous
S
0

Primary reason for the error you have mentioned is "CORS". Cross-Origin Resource Sharing.

Your image is not accessible to the calling iframe script. Which is hosted on Google servers.

http://enable-cors.org/

Once you enable CORS, it will work. The reason you have mentioned that it started working once you cloned it locally, is the same. Now the vr script and image are having same origin :)

Searle answered 15/9, 2016 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.