I want to capture frames from Unity3d virtual camera and then let them displayed on another raw image.The result is that the raw image screen flickers very much.
using UnityEngine;
using UnityEngine.UI;
public class RawImageVirtualWebCamTexture : MonoBehaviour
{
private RawImage rawimage;
void Start()
{
GameObject obj = GameObject.Find("RawImageTransform");
rawimage = obj.GetComponent<RawImage>();
}
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (source != null)
{
rawimage.texture = source;
}
Graphics.Blit(source, destination);
}
}
I want to see smooth pictures. But how to do that?