RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

Video was not displayed in Vision Pro when using Polyspatial #1800

Open from2001 opened 3 months ago

from2001 commented 3 months ago

Describe the issue Video was not displayed in my Vision Pro. It worked in my Unity editor, but it didn't work with the actual device.

Your Setup (please complete the following information): Unity 2022.3.19f1 Poly Spatial 1.1.6 visionOS 1.1.1 UnBounded Scene (Mixed reality mode) AVPro Video v3 - Ultra Edition: Version 3.0.0

To Reproduce

  1. Prepared a Quad as a video screen with ApplyToMesh or ApplyToMaterial (Both didn't work)
  2. Used Universal Render Pipline/Unlit shader and _BaseMap as Texture Property.
  3. Place the Video screen quad into Unity Poly Spatial mixed reality sample scene.

Screenshots

Screenshot 2024-03-27 at 23 30 08 Screenshot 2024-03-27 at 23 32 51
ymPoirier commented 3 months ago

Found for now a workaround, which might have some issues but it's a start i guess.

I'm using a RenderTexture I created in Assets. I use AVPro's Media Player and the ResolveToRendertexture script from AVPro (instead of applytomesh or material). And a little script using Polyspatial which I think allow Polyspatial to find and convert the Render texture and make it compatible with visionOS. Just place the script on a gameobject and drag and drop the render texture.

I think (and then again, sorry if it's fuzzy i'm no expert) ApplytoMesh and ApplytoMaterial don't work because both script create rendertexture during runtime and Polyspatial has no idea where to find them and make them compatible with visionOS.

  using UnityEngine;
  using Unity.PolySpatial;

  public class SetRenderTextureDirty : MonoBehaviour
  {
      public RenderTexture texture;

      void Update()
      {
          Unity.PolySpatial.PolySpatialObjectUtils.MarkDirty(texture);
      }
  }
from2001 commented 3 months ago

Thank you. The workaround worked. I hope Unity will fix the problem or AVPro team will fix the problem soon.