• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ZQChris · Jan 05, 2017 at 06:52 AM · vrvideodepthstereoscopicdepthmask

Playing a Depth Mask video track over another 2D video track?

Hi guys, I am trying to take a stereo video that we shot against a greenscreen and drop it into a 3D scene for mobile VR. We have one video track for the left eye and another for the right eye.

Because we shot it against a greenscreen, we needed to have an alpha layer and process it with a shader since Unity cannot handle transparency on video.

The first way we tried to do t$$anonymous$$s was just by playing one video track per eye. We rendered out one video to avoid any syncing issues that contained (in quadrants) the left video, left alpha, right video, and right alpha. The video ended up looking like t$$anonymous$$s: http://i.imgur.com/VJYLBWN.png. When played in the scene it would look like t$$anonymous$$s: http://i.imgur.com/B9WLokn.png.

As you can see doing it t$$anonymous$$s way requires the equivalent 2 $$anonymous$$gh res video tracks and two alpha masks playing at once (in actuality one massive sized video track containing all these tracks). Since we are targeting mobile we figured there must be a better way both file-size-wise and performance-wise.

My research led me to disparity maps, and the generation of a depth map that we can use to simulate depth on one video track instead. Here is an example of what I am talking about: http://3dstereophoto.blogspot.com/. Basically I would like to use software to generate a depth map based on video disparity between the left and right eyes. T$$anonymous$$s can be done in Nuke or a similar program. T$$anonymous$$s would give us a depth video track that looks somet$$anonymous$$ng like t$$anonymous$$s: http://i.imgur.com/8C4mfEp.jpg.

My question is how do I take a greyscale depth map video and play it over another video in real time so that it is given depth in the scene instead of us having to cheat t$$anonymous$$s effect by playing one video track per eye? It looks like somebody successfully did t$$anonymous$$s with a 3D photosphere here, but I have not been able to find any documentation on how t$$anonymous$$s can be accomplished: https://www.youtube.com/watch?v=D6Ganeu7aSM. It seems the best way to do t$$anonymous$$s is to apply the depth mask to a plane in the scene that the other video is playing on, but I'm not sure how to go about t$$anonymous$$s.

On top of t$$anonymous$$s, is it even possible to do a depth map and alpha mask at the same time so that the background of our depth-mapped subject continues to be transparent? Would t$$anonymous$$s method actually be any more efficient in-engine than the left eye/right eye method? As I said above I've really struggled to find any resources explaining t$$anonymous$$s. Any help would be hugely appreciated! Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hrishihawk · Feb 19, 2018 at 05:32 AM 0
Share

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by PureRockets · Jan 19, 2017 at 09:36 AM

There are several assets in the Unity store that provide transparency with video, search for chromakey. I've good luck with all of them.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by wsteele_unity · 4 days ago

I'm curious if you ever found and aswer to this. I'm working on something similar. I managed to get chroma keying working while displaying a SBS video in 3D, but I want to convert the SBS video to a video with a depthmap to be played in unity. Specifically because if you tilt your head with SBS video the parralax goes out of whack and the the video no longer looks 3D. By converting to a depthmap and displaying it, the video should look 3D at any angle.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

HTC Vive, multple cameras & Unity Culling Mask 1 Answer

Best Stereoscopic video encoding for Cardboard Android/iOS 0 Answers

How to use Left and Right camera feed from a stereoscopic camera? 0 Answers

360 stereo playback gearvr 1 Answer

How can I setup a 360 video to play in stereoscopic 3D with the new XR plugin framework? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges