1
\$\begingroup\$

I want to implement a 360-degree viewer for Augmented-Reality in Unity. Augmented-Reality means in this case, that I want to place an image like an interface mockup in my viewer which has transparency. The transparency is getting filled with the real world. So the real world part is working without problems, but that is also the reason, why a sky box is not possible since the sky box would block that.

So I already had 2 approaches:

  1. A sphere with a shader which rendered only the inside (turned the normals), worked on my MAC, but didn't render anything on my vr/ar device (Samsung GearVR)... Here a picture how it should look like and does look like in the Unity Editor. But nothing of this "crosshair" is showing up on the GearVR
  2. A sphere or cylinder where I turned the normals beforehand in Blender, didn't apply the texture correctly and didn't show anything in Unity and on Device except a blank color.
\$\endgroup\$
  • \$\begingroup\$ The whole point of AR is to put real world on background, why do you bother adding a skybox onto it? \$\endgroup\$ – S. Tarık Çetin Jul 28 '16 at 16:56
  • 1
    \$\begingroup\$ It's not clear to me from this description what you're trying to accomplish, what you've tried (including which shaders you used), and how the output differed from your expectations. Please consider updating this question with screengrabs from the game/editor illustrating these aspects in more detail. \$\endgroup\$ – DMGregory Jul 28 '16 at 17:28
  • \$\begingroup\$ @S.TarıkÇetin like I said I want a "skybox" which has transparency so that you are still able to see the real world. The point why I want this is just so that I can easily drag'n'drop interface mockups from e.g. photoshop into my scene and view it in my AR Device. I will update the question for better understanding :) \$\endgroup\$ – TobiasW Jul 29 '16 at 6:46
  • 1
    \$\begingroup\$ I've used solution #1 in an Android app before and it worked as expected. However, I didn't try to do this with transparency or with an AR toolkit in place. What AR toolkit are you using? It's possible that the video plane (the object that the video from the camera is being drawn on) is closer to the camera in the Android build than it is in the desktop one, or that the rendering is done differently. \$\endgroup\$ – Steve Harding Jun 6 '17 at 22:34
1
\$\begingroup\$

Yes, this is certainly possible. You'd need to use a sphere with inverted normals or a shader that had backface culling disabled.

Depending on the content you wanted to put on the inside, it could be fairly static information like would exist in a texture. Or you can even use Unity's UI by modifying the UI's mesh, first to tessellate it to add vertices, then to reposition the vertices for it to be curved (you can see an example of this in this asset). This will provide a much easier interaction model (using the existing UI system) and allow you to quickly prototype new interactions.

If you're deploying to a mobile device, you'll have to be careful about the shader you use, and make sure it's supported by the platform you want to use it on.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.