Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Unity VideoPlayer Near/Far Clip Plane mode mysteriously not working

Discussion in 'Audio & Video' started by Teejay5, Jul 14, 2022.

  1. Teejay5

    Teejay5

    Joined:
    Feb 26, 2010
    Posts:
    106
    I'm trying to play a video in my Unity project using VideoPlayer, and no matter how I set it up, only RenderTexture mode works. If I set the component up to play on the target camera's near or far plane, nothing happens upon pressing play. I have thoroughly troubleshot my setup. I am using Unity 2020.3.36f1. We are using the built-in render pipeline.

    Things I've tried:

    New scene with nothing but the videoplayer component and camera
    - Nothing happens except when using RenderTexture mode
    New Project with same Unity version and same video clip
    - Works Perfectly
    Re-enabling Unity Audio since my project uses FMOD
    - No effect, audio only plays back when using RenderTexture mode
    Workaround attempt: Using RenderTexture mode, and displaying the video via a RawImage on a UI Canvas
    - The video appears to work in-editor, but shows up black in the game view:

    upload_2022-7-13_19-28-12.png

    The project is quite big, is it possible for an external package to mess with the built in Unity video player?
    Also is the Unity VideoPlayer a package that can be updated by itself? It doesn't appear to be.
    I would file a bug report but I don't know how to even begin reproducing this issue.

    Sidenote: I have not tested Material Override or API Only modes.
     

    Attached Files:

  2. Teejay5

    Teejay5

    Joined:
    Feb 26, 2010
    Posts:
    106
    Took a look at the frame debugger:
    upload_2022-7-14_3-28-47.png

    It should appear at Render.TransparentGeometry, and you can even see the correct texture appear under the Textures_MainTex Line.
    Huh.
     
  3. Teejay5

    Teejay5

    Joined:
    Feb 26, 2010
    Posts:
    106
    Aw jeez. For some reason, I had a folder full of the built-in shaders from Unity 2018 in my project folder from forever ago. That's why Standard shader was appearing twice in the shader list. That folder's shaders were overriding the built-in shaders it seems. I deleted the folder, the entire editor turned pink. I restarted, and now everything works fine. As much as an L this is, I'm gonna keep it up in case someone else has this insanely specific problem lmfao