RenderHeads / UnityPlugin-AVProVideo

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

Issue at "equator" in 180 degree equirect using "InsideSphere Unlit (stereo+fog)" shader #430

Closed jrjones closed 4 years ago

jrjones commented 4 years ago

Describe the bug A visual glitch (which resembles but isn't a stitching error) occurs at the "equator" of VR180 content rendered onto the half-octahedron-sphere mesh. Only occurs with 180 degree equirects in "InsideSphere Unlit (stereo+fog)" shader-- does not occur with 360 equirects on full octahedron sphere, nor does it occur with the "InsideSphere Unlit (stereo+fog) Stereo UV" shader.

(However, the Stereo UV shader is not properly rendering stereo content on Quest, which is why I'm using the other shader.)

Your Setup (please complete the following information):

(My ultimate target is Quest, but this behavior is reproducible in the editor with a VR headset attached (or without a headset for non-stereo content)

1,) VR180 3D SBS 4096x2048 h.265 ~16 megabit ~1 gigabyte filesize Sample 3D-SBS video can be found here: https://gfl-mpx-04.s3-us-west-2.amazonaws.com/venice-4096x2048-SBS-HEVC-high.mp4

2.) VR180 2D 2048x2048 Sample 2D 180 video can be found here: https://gfl-test3.s3-us-west-2.amazonaws.com/gondola-2048p-2D.mp4 Reproduces with all 180 degree content I have tried, including stereo and mono.

To Reproduce

  1. Add the half-octahedron sphere object from the AVPro demo folder
  2. Add player, ApplyToMesh, etc. to an empty game object targeting the half-sphere. Target a 180 degree video (stereo or mono)
  3. Use the sphere180 material provided by AVPro, select the AVPro/VR/InsideSphere Unlit (stereo+fog) shader
  4. If 3D, add an UpdateStereoMaterial component and wire it up
  5. Build and play (in editor, on PC, or on Quest)

Expected behavior: video is rendered correctly

Actual behavior: rendering issue at equator of video Screenshots image

Videos If applicable, add a copy of your video or the URL https://gfl-mpx-04.s3-us-west-2.amazonaws.com/venice-4096x2048-SBS-HEVC-high.mp4 https://gfl-test3.s3-us-west-2.amazonaws.com/gondola-2048p-2D.mp4

Can provide simplified project to demonstrate issue if desired

AndrewRH commented 4 years ago

Have you tried using the full sphere mesh instead? I think it works correctly with that. We also have a demo scene that demonstrates 180 videos displaying correctly.

Does that help?

jrjones commented 4 years ago

With the full octahedron sphere, you get the awful mirroring in each eye, with a smear of the last pixel at the edge in the other eye to the hemisphere behind you. Is there an easy way to prevent that behavior without going to the broken half-sphere?

jrjones commented 4 years ago

Also, and in this case I'm sure I'm just messing up the settings in your demo scene, stereo is breaking on Windows and in editor. (See screenshots below.)

I'm already programatically switching meshes and materials (and will be happy to only switch out the mesh) so I guess I can swap in the Stereo UV shader version on Windows to fix the stereography.

I'll experiment a bit more and get back to you within a day or two... but the mirroring/smear behind you in 180 is problematic.

image

image

jrjones commented 4 years ago

And thank you, by the way. Before purchasing I watched how responsive you guys are on GitHub/issues and it was a major part of my purchasing decision. Very few assets are so well supported.

AndrewRH commented 4 years ago

And thank you, by the way. Before purchasing I watched how responsive you guys are on GitHub/issues and it was a major part of my purchasing decision. Very few assets are so well supported.

Thanks! It's actually difficult to keep up with all of the support, but we try our best and we realised this is actually super important to make sure we have a product that is useful to people.

Thanks for reporting the issue with 180 - I will investigate further and get back to you.

AndrewRH commented 4 years ago

With the full octahedron sphere, you get the awful mirroring in each eye, with a smear of the last pixel at the edge in the other eye to the hemisphere behind you. Is there an easy way to prevent that behavior without going to the broken half-sphere?

Hi,

I think the mirroring issue is because you're using the normal InsideSphere shader instead of the InsideSphere Transparent version, which allows transparent and feathering of the edges: image

Thanks,

AndrewRH commented 4 years ago

Also, and in this case I'm sure I'm just messing up the settings in your demo scene, stereo is breaking on Windows and in editor. (See screenshots below.)

  • On Windows/Unity Editor when viewed in a headset, stereo is wonky to a point of inducing projectile vomiting
  • ~On Quest, it shows both eyes in both eyes.~ found a fix, just need to conditionally swap some settings btwn editor and android.

I'm already programatically switching meshes and materials (and will be happy to only switch out the mesh) so I guess I can swap in the Stereo UV shader version on Windows to fix the stereography.

I'll experiment a bit more and get back to you within a day or two... but the mirroring/smear behind you in 180 is problematic.

image

image

Yes the reason it's not working correctly on Windows is due to a limitation of our plugin. Videos that contain stereo metadata are not displayed correctly on Windows - only the left eye is decoded. This is not a problem on other platforms. The only solution currently is to remove the stereo metadata or not embed it in the first place. We have a major update to the plugin coming soon (AVPro Video 2.0) which doesn't have this issue.

I'm not sure why you need the Stereo UV Shader - are you supplying your own custom UV's? Otherwise you should just use the standard / transparent InsideSphere shader

I hope some of this information helps you.

Thanks,

jrjones commented 4 years ago

Combination of the unlit-transparent shader for 180 and removing the metadata for Windows works, thank you again.

Looking forward to 2.0, as these assets are used in multiple places so removing the metadata is a workflow hassle.

Thanks!