private void Awake() { RenderTextureDescriptor rtxDesc = new RenderTextureDescriptor(width, height); rtx = new RenderTexture(rtxDesc); rtx.Create(); Camera camera = GetComponent <Camera>(); camera.targetTexture = rtx; CVBridge.SetCVTexture(cvTexIndex, width, height, rtx.GetNativeTexturePtr().ToInt32()); }
private void Awake() { texture = new Texture2D(width, height, TextureFormat.ARGB32, false); CVBridge.SetCVTexture(cvTexIndex, width, height, texture.GetNativeTexturePtr().ToInt32()); GetComponent <Renderer>().material.mainTexture = texture; }