Forum Discussion
motorsep
10 years agoMember
Stereo skybox ?
Is there a way to setup stereo skybox in Unity for Gear VR using a pair of equirectangular skybox images ? If so, how?
Thanks.
Thanks.
23 Replies
Replies have been turned off for this discussion
- Gforman123ExplorerI'd use Unity's layers.
Just make two spheres in the same spot with the correct left and right images mapped to them and assign the sphere with the left eye image to a layer called left and the one with the right eye image to a layer called right. Make a second camera and set the Target Eye setting to left or right (and change the original's target eye to the remaining one) and in the Culling Mask for the left camera uncheck the right layer and vice versa for the right camera. - motorsepMemberActually I am lost on this one, sorry.
I have 2 skyboxes (2 cubemaps or 2 horizontal strips, which I can cut up into 6 images per eye). I totally have no idea about layers and how to assign them per eye.
Could you please go into more details about it or point me to a tutorial/docs ? Thanks. - cyberealityGrand Champion
- motorsepMemberInteresting, thanks.
However, I am not sure how to make actual stereo skybox in Unity, since regular skybox is a built-in shader according to Unity docs: http://docs.unity3d.com/Manual/HOWTO-UseSkybox.html
Any ideas?
Thanks! - cyberealityGrand ChampionYou can just make your own skybox in that case.
- motorsepMember
"cybereality" wrote:
You can just make your own skybox in that case.
I know that I need to make my own skybox for this :)
What I am asking is how. In Quake 3 / Doom 3 skybox is a box (geometry) with material applied that contains skybox shader, which will make the box have no seams, unlit and looks like infinitely far away skies.
Do I just make a box-mesh for Unity and apply skybox material to it? (and make it two, one per eye)
How do I UV map it? - rhillHonored GuestTypically I'd apply that material to the environment lighting as shown in the manual you linked, but that would of course apply it to both eyes equally. There is also a way to add it to a camera:
http://docs.unity3d.com/Manual/class-Skybox.html
"To add a Skybox Component to a Camera, click to highlight the Camera and go to Component->Rendering->Skybox."
Though note you use the phrase "infinitely far away skies" when you describe how skybox is normally used. Anything infinitely far away has infinitely small difference between the left and right eye. If you're using a skybox for things close up to you, that's an unusual way to use a skybox. - motorsepMember
"rhill" wrote:
Typically I'd apply that material to the environment lighting as shown in the manual you linked, but that would of course apply it to both eyes equally. There is also a way to add it to a camera:
http://docs.unity3d.com/Manual/class-Skybox.html
"To add a Skybox Component to a Camera, click to highlight the Camera and go to Component->Rendering->Skybox."
Though note you use the phrase "infinitely far away skies" when you describe how skybox is normally used. Anything infinitely far away has infinitely small difference between the left and right eye. If you're using a skybox for things close up to you, that's an unusual way to use a skybox.
Thanks, but I wonder if that would work with method described by Cybereality, where each skybox has to be on a separate layer with culling mask applied.
I am sure you looked at OTOY's spherical (although made with cubemaps) stereo panoramas. Technically, those are skyboxes. Since mobile VR is limited with polygons and such, and for the most part player would be still, using pre-rendered environments in addition with actual geometry is a good trick to make environments seem large or more integrated.
It's also useful for arch-viz, to add more depth for outdoors, or actually have pre-rendered stereo skyboxes and teleport player from room to room - fast performance, looks 3D and photorealistic. Could probably blend day/evening/night skyboxes into one another to simulate change in lighting conditions without performance penalties. - motorsepMemberFound something for Google Cardboard: https://developers.google.com/cardboard/unity/guide
Apparently they provide a script that adds parallax to skyboxes (I assume box meshes). I don't believe I saw anything like that in Oculus samples or Utils. - rhillHonored GuestApplying a skybox to each eye camera would be an alternative to applying them with layer masks. The layer masks are useful for distinguishing meshes that are rendered in the scene.
If you want something in the scene you could also make a very large cube or sphere with your textures applied, but that doesn't use the skybox material.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago
- 10 months ago