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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

jittery 360 video playback

Discussion in 'AR/VR (XR) Discussion' started by DistortionFactor, Dec 22, 2015.

  1. DistortionFactor

    DistortionFactor

    Joined:
    Nov 23, 2015
    Posts:
    8
    When I try to play 360 video on a textured sphere, I see tons of jitter when the head moves. If the head is still, the jitter is not a problem.

    I suspect the way I keep the geometry in the view is the problem. Is there another way to keep the sphere geometry in view other than what I am doing?

    void FixedUpdate() {
    sphere.transform.position = camera.transform.position;
    }

    I'm using Oculus on Windows 8.1 with Unity 5.3 - VR support is enabled in PlayerSettings.
     
    Last edited: Dec 22, 2015
  2. SniperEvan

    SniperEvan

    Joined:
    Mar 3, 2013
    Posts:
    161
    Does the sphere have to snap to the head position?

    Usually VR is more comfortable when the player can move their head side to side and up and down (it feels more believable to the brain). If the video is following the head position the user might feel like their head is staying in the same spot.

    If it makes sense in the context of your game, I would try making the sphere bigger and keeping it stationary. Then the player can bob their head around and it will feel a little more natural. If it moves too much and distorts the video make the sphere bigger.
     
  3. DistortionFactor

    DistortionFactor

    Joined:
    Nov 23, 2015
    Posts:
    8
    @SniperEvan Hey - thanks for the response. I'm not familiar with the 'snap to' feature. So - no, I am not using it. The player can still move their head, in rotation. Since the video was recorded from a single viewpoint, I believe it is most correct to not allow translation of the viewpoint.

    I would not want the player to put their viewpoint through the geometry of the sphere.
    Sorry, I just realized you addressed this. Still, I don't think there is value in allowing the user to translate their viewpoint to cause any projection differences.


    I updated my code above. I was using the Update() method. Now I'm using the FixedUpdate() method but it exhibits the same problem.
     
  4. DistortionFactor

    DistortionFactor

    Joined:
    Nov 23, 2015
    Posts:
    8
  5. DistortionFactor

    DistortionFactor

    Joined:
    Nov 23, 2015
    Posts:
    8
    It's not my code causing the jitter.
    • I removed my tiny script that attempts to follow the camera
    • I followed the advice of @SniperEvan and made my sphere really big (scaled Unity Sphere primitive x100)
    My world has a lobby where I select which movie to play. That lobby is rock-solid, no jitter. I only see jitter when looking at the inside of the sphere with a MovieTexture.

    My current theory is that the texture sampling is set to Nearest, but I don't see an option to change it in the Inspector. Maybe this is another shortcoming of video textures & Unity.

    upload_2015-12-22_15-4-9.png
     
  6. Tubbritt

    Tubbritt

    Joined:
    Nov 30, 2015
    Posts:
    46
    It's far more likely that the problem is unity itself.

    When you import a video Unity converts it to Ogg Theora format. Which is extremely CPU intensive to playback as a movie texture.

    To solve the problem, you have to use some third party asset like this one.
    https://www.assetstore.unity3d.com/en/#!/content/2546

    Regards
    James.