cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply the Rift specific skybox?

adam
Honored Guest
Hi,

I've made the unity car-tutorial rift-ready (see here).

I want to switch to using the special Rift skybox but don't know how to go about it.

Could someone provide the steps to take the skybox from the rift-unity integration packages and apply them to another scene/project?

Thanks, Adam
76 REPLIES 76

Marbas
Honored Guest
Great script Nora. Thanks!

The cubed skybox works fine when running the app inside the Editor, but for some odd reason the skybox isn't visible when run as a build (x86). Any ideas how to fix this?

*EDIT*
I tracked down the problem having something to do with the shader generated by the script.
On my end using the script's default "Unlit/Texture" doesn't work in build. (Works in editor)
Changing "Unlit/Texture" to "Self-Illumin/Diffuse" gives approximately the same visual effect and works in both editor and build.

Verge
Honored Guest
I think I have a better solution for the missing skybox after deployment. The skybox isn't visible, because it isn't assigned to a material when building. Unity strips out all unused assets to keep the build size down.

If you create a "Resources" folder and put the used shader in there you can force it to be included in the build. 🙂

Marbas
Honored Guest
I agree that using the script's original "Unlit/Texture" shader would be better.

But why then would unity include the "Self-Illumin/Diffuse" and not the "Unlit/Texture" shader?
Note that I've only changed the string-name in Nora's script for the type of shader to generate.
There really shouldn't be any difference.

Verge
Honored Guest
Well, I'm also using the Unlit/Vertex Color Multiply Background from the topic below, so I have a shader file.

viewtopic.php?f=37&t=1451&hilit=skybox

But I had the same problem with the skybox not showing. "Unlit/Texture" isn't used somewhere else in the scene would be my guess, so at build it isn't compiled. "Self-Illumin/Diffuse" is included, because it is used somewhere else in your scene. So you can use another shader or place a shader in the Resources folder and use that one. 😄

Marbas
Honored Guest
Im positive that "Self-Illum/diffuse" isnt in use in my project. Actually I tried a bunch of different shaders to find one that works visually for the skybox, and build ofcourse. Each of them worked, but not the "Unlit/texture" :mrgreen:

Nora
Honored Guest
Update SkyboxMesh.cs.

- Fix shader(material) code.
Instead of Unlit/Texture, I made ​​it to initialize the shader dynamically.

> Marbas
Thank you for your report, In the old script, Shader.Find () would fail if the Unlit/Texture is not included in the build.

daatgaming
Honored Guest
This is awesome! Thank you for taking the time to write this.

DarkMagicCK
Honored Guest
Thanks Nora! Nice work.

Everything works fine except Follow a target. Maybe it's my misunderstanding, but change "PostUpdate" to "Update" solved this problem. How will "PostUpdate" work to update the transform?

daatgaming
Honored Guest
Hey, wait. This is unity, so shouldn't it be LateUpdate()?

Nora
Honored Guest
Update SkyboxMesh.cs

- Bugfix follow target. ( Correction of spelling errors. PostUpdate () to LateUpdate() )

> DarkMagicCK, daatgaming
Thanks, and be sorry that it has not been tested.