Hey everyone!
I have a Unity project where I am taking the live 360 degree video from a Ricoh Theta X camera (wired to computer via USB-C to USB-A 3.0 cable) and displaying it on a skybox in Unity. I am doing this by attaching the live video feed from the camera onto a hidden sphere in the scene by having the following code assigned to the sphere.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class videoStream360 : MonoBehaviour
{
public Material skyboxMaterial; // Drag your skybox material here in the Unity editor
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of webcams connected: " + devices.Length);
for (int i = 0; i < devices.Length; i++)
{
string camName = devices[i].name;
Debug.Log("Webcam device " + i + " is " + camName);
}
// Set a higher resolution and frame rate
WebCamTexture mycam = new WebCamTexture(devices[4].name);
// Set texture filter mode to improve quality
mycam.filterMode = FilterMode.Bilinear;
// Assign the WebCamTexture to the skybox material's texture
skyboxMaterial.SetTexture("_MainTex", mycam);
mycam.Play();
}
void Update()
{
// Optionally, you can add dynamic updates to the skybox here if needed.
}
}
The reason for doing this is I then attach a meta quest 2 headset to Unity and when viewing the scene through the headset I am able to see the 360 degree video environment. I am having an issue right now where the quality of the video when being viewed through the headset is not good enough. I have tried a couple different things to get the quality better but have not had success. Does anyone know of any ways to get the quality of the camera better into Unity and into the headset? Thank you!