Texture support in PolySpatial

Hi there, I have a general question about wether a Texture received through VideoStream supported in Unity? Currently I can view them in Editor, but in both Game Scene or Simulator, they are just blank.

If you’re using the VideoPlayer component, you may have missed the need to call MarkDirty to indicate that the RenderTexture should be transferred through PolySpatial.

1 Like

Hi, let me try to explain again what I have met.
For now I am receiving texture from a streaming channel.

        void OnTrack(RTCTrackEvent e)
        {
            Debug.Log("Received OnTrack event");

            if (e.Track is VideoStreamTrack videoTrack)
            {
                videoTrack.OnVideoReceived += (Texture texture) => OnVideoFrameReceived(texture);
            }
        }

        private void OnVideoFrameReceived(Texture texture)
        {
            receiveImageMaterial.SetTexture("_MainTex", texture);
        }

And I tried to set the receiveImageMaterial to a MeshRenderer(Quad for example). I can still only see the Images in Scene not in Game. I’ve also tried to mark MeshRenderer Dirty with following code but nothing changed.

public class setRendererDirty : MonoBehaviour
{
    public Renderer rendererComponent;

    private void Start()
    {
        rendererComponent = GetComponent<Renderer>();
    }

    // Update is called once per frame
    void Update()
    {
        if (rendererComponent != null)
        {
            PolySpatialObjectUtils.MarkDirty(rendererComponent);
        }
        
    }
}

I have also tried converting texture to RenderTexture with Graphic blit and mark RenderTexture Dirty afterwards. Nothing get worked unfortunately. Thanks for the suggestions in advance.