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 applemaniac · Oct 06, 2017 at 07:17 AM · mirrorreflectionstereoscopy

Mirror reflections and stereoscopy

Hello everyone !

I am having an issue with stereoscopy and mirrors. This is happening with a HTC Vive and the steamVR asset, but it does not seem to be related to the hardware.

I am using shaders to render mirrors (as someone explained in the video https://www.youtube.com/watch?v=AvxGw_sZisk&t=91s). It works, but not perfectly well as the images of right and left eyes are very different and the brain cannot merge it.

Any idea where the issue would be ?

Thank you :)

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bodhid · Oct 06, 2017 at 09:16 AM

I did this once for the Vive, What worked for me was creating 2 mirror camera's, each following an eye.

Both camera's follow the eyes on the other side of the mirror, and with a reflect you can calculate the rotation. Then send the RenderTexture of both eyes to a shader variable. Finally you could use layers to render 2 mirrors, one for each eye. And each mirror should render (in screen space) the corresponding rendertexture.

I found this beautifull example on google: alt text

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 Bodhid · Oct 06, 2017 at 09:19 AM 0
Share

To get the rotation and position of each eye, use UnityEngine.VR.InputTracking.GetLocalPosition(LEFT OR RIGHT) and UnityEngine.VR.InputTracking.GetLocalRotation(LEFT OR RIGHT)

avatar image s1nc1tycyph3r · Oct 13, 2017 at 12:41 AM 0
Share

I'm Curious I'm Trying To Implement The Same Technique you suggested But For GoogleCardboardVR Is there a way to access the left and right eye positions for Gvr that is equivalent to the UnityEngine.VR.InputTracking.GetLocalPosition(LEFT OR RIGHT) and UnityEngine.VR.InputTracking.GetLocalRotation(LEFT OR RIGHT) code you mentioned?

avatar image Bodhid s1nc1tycyph3r · Oct 13, 2017 at 08:47 AM 0
Share

Yes. Cardboards prefab has a $$anonymous$$ain Camera, it's children are the transforms for Left and Right eye. "$$anonymous$$ain Camera Left" and "$$anonymous$$ain Camera Right"

avatar image s1nc1tycyph3r Bodhid · Oct 14, 2017 at 06:16 AM 0
Share

Yeah the latest GVR for Unity Plugin No Longer Has Those Prefabs, And From What I Can Gather GvrEditorEmulator Has Replaced the old GvrViewer$$anonymous$$ain So This Is Where I'm Having Trouble Figuring Out how to access the left and right eye cameras

i did find this code however at the bottom of the GvrEditorEmulator .cs script

 private IEnumerator<Camera> ValidCameras() {
     for (int i = 0; i < Camera.allCameras.Length; i++) {
       Camera cam = Camera.allCameras[i];
       if (cam.stereoTargetEye == StereoTargetEye$$anonymous$$ask.None) {
         continue;
       }
 
       yield return cam;
     }
   }


i'm thinking if i create the a similar function in a custom script i should be able to acces the left and right eye cameras via something like this

 private Camera GetLeftEye(){
 Camera leye;
 for (int i = 0; i < Camera.allCameras.Length; i++) {
           Camera cam = Camera.allCameras[i];
 if (cam.stereoTargetEye == StereoTargetEye$$anonymous$$ask.Left) {
            leye = cam;
            break;
           }
 }
 return leye;
 }
 private Camera GetRightEye(){
 Camera reye;
 for (int i = 0; i < Camera.allCameras.Length; i++) {
           Camera cam = Camera.allCameras[i];
 if (cam.stereoTargetEye == StereoTargetEye$$anonymous$$ask.Right) {
            reye = cam;
            break;
           }
 }
 return reye;
 }

am i correct in this assumption?

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

73 People are following this question.

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

Related Questions

Complete Flat Mirror Reflection shader 0 Answers

Render Texture2D mirrored horizontally 1 Answer

Can't change Camera.stereoSeparation 3 Answers

MirrorReflection with Multiple Cameras 1 Answer

How to create a "Mirror Ball" type Pinball 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