Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
0
Question by oliver9523 · May 27, 2016 at 12:15 PM · ui3dstereoscopic

2 Cameras 1 UI

I'm making some software that uses a 3D projector for the display. I have two cameras (left/right), they render the scene as side-by-side images so the projector can split the input video feed and display the left and right images as it needs.

I have a UI in camera space, however I can only link the UI to one camera but I need it linked to two.

In the attached example I have the stereo-camera output from unity (with the adjusted aspect ratio to compensate for the stretching the projector does). What I'm trying to achieve is a canvas in both cameras (the black buttons) that have the same offset (zero disparity)

I could create two UIs (UI Left, UI Right) and link each one to a camera (Left, Right) and just update them both but that's a lot more work and messy to manage.

If I create the UI in screen space it wont have the correct aspect ratio and will also be split in half by projector.

Any ideas?

Example

copy-of-3d-ui-1.jpg (57.8 kB)
Comment
Add comment · Show 7
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 YoungDeveloper · May 27, 2016 at 01:45 PM 0
Share

Your title gave me some bad memories.

avatar image oliver9523 YoungDeveloper · May 27, 2016 at 01:48 PM 0
Share

It's as if I did that to get people to read it ;)

avatar image Pharaoh_ · May 27, 2016 at 02:32 PM 0
Share

Sorry, I didn't get your reason of aspect ratio. What's the problem again if you use Screen Space - Overlay?

avatar image oliver9523 Pharaoh_ · May 27, 2016 at 03:14 PM 0
Share

A 3D projector splits the input video in half and stretches it to fill the whole screen. Check out some examples on youtube (https://www.youtube.com/watch?v=u0hm$$anonymous$$t5znX0) The image in each camera is 'squashed' so that when they are processed by a projector in side-by-side mode the projector stretches the image back out to fill the screen. I guess I should relabel the diagram to "desired projector output".

avatar image Glurth · May 27, 2016 at 03:26 PM 0
Share

"If I create the UI in screen space it wont have the correct aspect ratio and will also be split in half by projector."

I don't see why it would be split in half. Though I do see how it's width would be doubled. Why not make the UI with 1/2 width by default, and/or adjust the UI sclae on startup based upon the apect ratio. This should be a single line of code, if you make all UI objects the child of some "base UI scaling" object.

avatar image oliver9523 Glurth · May 27, 2016 at 03:41 PM 0
Share

Because the projector takes the input video (1920x1080), splits it into two video streams of (960x1080), resizes each stream back to (1920x1080), it then flashes the two video streams alternately (for left and right eye). Yes I could set the UI to screen space and adjust the aspect ratio, however it will only ever be displayed for one eye at a time (left or right). I need to add the UI to the screen space twice somehow...?

avatar image Glurth oliver9523 · May 27, 2016 at 04:20 PM 0
Share

Ah, I see. So why not put the UI in the same world space as your cubes? (and scale by aspect ratio, at startup). Because it would get doubled... never$$anonymous$$d, I see now. hmm. Theoretically, you could offset the UI's worldspace position, when you switch camera's, such that it would appear at the same screen-space position for both camera's. That's some serious math tho. Edit again: But YOU, are not switching the camera's, so you would need both positions displayed at once. hmmm.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Glurth · May 27, 2016 at 04:39 PM

ok another idea: though I'm not sure how you get the two camera's to combine into a single stereo output screen, but can you use that same method to output TWO MORE cameras to the same screen? If so, those two camera's can be filtered to show only the UI, and you can adjust their position to NOT stereo-scope the result (by giving them the same world-position).

Comment
Add comment · Show 4 · 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 oliver9523 · May 28, 2016 at 01:01 PM 0
Share

yeah, I like that. I'll give that a try.

avatar image Glurth oliver9523 · May 28, 2016 at 02:56 PM 0
Share

Great! I'm interested, so please come back and let me know how it works out!

avatar image oliver9523 Glurth · Jun 03, 2016 at 09:03 PM 0
Share

That worked a treat :) - I have a world space UI - Two more (UI) cameras at the same location as the left stereo - Each 'ui'-camera is set to UI culling mask and clear flags as 'depth only' - The viewport of each 'ui'-camera is set accordingly to fill each half of the screen - The aspect ratio is adjusted on runtime to compensate for side-by-side projector distortion

Submit it as an answer so I can accept it.

Show more comments

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.

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

Game is in Stereo 3D, but I want that the UI looks 2D. Do you know how it works? 1 Answer

how do I stop adding force after the button is released,How do i stop adding force after I release the button in Unity3d? 2 Answers

Render Texture vs 3D model in screen space - camera 1 Answer

Is it better to use 3D text or a UI canvas in world space? 1 Answer

WorldToScreenPoint UI element showing up twice 1 Answer


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