Stream Ricoh Theta to Unity Skybox

Note: This was done with the Theta Z1, but should work with the others too.

Thought I’d share this here to help improve the quality of projects people are working on.

I noticed a lot of people are projecting the cam texture on a “inverted” sphere. The problem is that sphere’s are still polygons and create “edges” in your 360 image. It’s not pretty or professional. Even worse is if you decide to use it in room-scale VR - the sphere won’t move with you and it’ll just be weird (unless you make the sphere huge). The better way of doing it is to put it directly on the scene’s skybox.

  1. Create a new Material and name it ricoh360_skybox (for example). Change its Shader to “Skybox/Panoramic”.

  2. Open Window -> Rendering -> Lighting Settings. Then just drag that new Material you created into the “Skybox Material” box.

  3. Create a new script and call it “getRicohStream” (You can change it, but don’t forget to change the class name too).

Enter this C# code inside:

using UnityEngine;

public class getRicohStream : MonoBehaviour
{

    static WebCamTexture ricohStream;
    string camName = "RICOH THETA Z1 FullHD"; // Name of your camera. 
    public Material camMaterial;  // Skybox material

    void Start()
    {

        if (ricohStream == null)
            ricohStream = new WebCamTexture(camName, 3840, 1920); // Resolution you want

        if (!ricohStream.isPlaying)
            ricohStream.Play();

	if (camMaterial != null)
            camMaterial.mainTexture = ricohStream;

    }

}
  1. Save script

  2. In Unity, create an empty gameobject and attach the script to it.

  3. Drag in the “ricoh360_skybox” material in the “Cam Material” field under the script component of your new gameobject.

  4. Press Play.

(FYI - I couldn’t get the Ricoh Theta Z1 4K drivers working at the time of this post. That’s why I’m using “FullHD” instead for now.)

If anybody has suggestions for making it better, please do, as I am by no means a professional in Unity or C#.

1 Like

This is awesome. I’m going to put this link on an upcoming list of development docs. Should I attribute this to RicoB? Or, do you want your full name?

It will be linked off of a new site at theta360.guide.

Below is how I envision a dropdown menu off of “Docs” in the navbar.

That’s a great idea to have those docs, but you don’t need to put my name. I like to help where I can, not because of recognition, but rather because I know how grateful I would have been finding this information back then. So why not pass it along and help people progress with their projects and move on to the next headache quicker haha. Plus, it’ll look cleaner with just the title :wink:

1 Like