I was trying This Page to map Theta S camera to the sphere.
There are two half-spheres. The mapping is done by shaders, so I don't have to care about this. Both piece of sphere has same code: public int cameraNumber = 0; private WebCamTexture webcamTexture;
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
if (devices.Length > cameraNumber) {
webcamTexture = new WebCamTexture(devices[0].name, 1280, 720);
GetComponent<Renderer>().material.mainTexture = webcamTexture;
webcamTexture.Play();
} else {
Debug.Log("no camera");
}
}
What's the problem is, only "sphere1" renders WebCamTexture. I tested with additional test plane, and only the plane rendered WebCamTexture. (Both spheres didn't).
It seems only one gameobject can render one WebCamTexture. How can I render one WebCamTexture on multiple gameobject?
I already tried This and This, but both didn't work.
In This Page, it suggested a solution in one-line:
Which I couldn't understand. Can anyone help me?