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 avclubvids · Jul 26, 2018 at 10:00 PM · stereoscopic

VR: how to render gameobject in one eye only?

Back in the early days [TM] of 360º video in Unity we had to have two cameras and use layers to control which eye different gameobjects would render into. There have been considerable enhancements made and a lot of that happens under the hood now. I know I can manually make a stereo rig with two cameras and set their render eyes individually, but is there a way to set a gameobject to render in one eye or the other with the current XR setup using only one camera? Is this a shader-only thing?

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

2 Replies

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

Answer by OutOfRam · Jul 27, 2018 at 03:58 PM

Hello, Sadly there is no way to do this with the current single camera XR rigs, I have looked into this issue extensively for my own projects (even going so far as to directly ask the HTC people) and came up empty handed. The only way I know is the manual stereo rig, or shaders, which for the sake of anyone else who is looking for the solution i will also post here. If you are using the SteamVR cameraRig there is a fairly easy way to do this, however it is not completely bug free. You are going to want to add another camera to the rig as shown below. Camera (eye Left) will also contain a steamVR_Camera Component, and its regular camera component will be set to render to only the left eye. from there you can set to layers in your project RightEye and LeftEye and use the cameras individual culling masks to not render the respective layer alt text

The downside to this, which shouldnt have any effect on the actual game but will make debuging a bit of a nightmare, is that while running a scene with this set up your console may be spammed with an error message saying something about an invalid Matrix. This can be ignored but can make it hard for you to find the real error messages to debug.


rigsetup.png (3.7 kB)
Comment
Add comment · Show 2 · 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 avclubvids · Jul 27, 2018 at 06:46 PM 0
Share

Does anyone have any experience with the shader approach? Is this as simple as adding an attribute or a flag to a regular shader, or does this require a totally specialized shader?

avatar image OutOfRam avclubvids · Jul 27, 2018 at 08:41 PM 0
Share

I absolutly suck at writing shaders, but if you have $20 you could check out this https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/vr-eye-shaders-88499

avatar image
0

Answer by hawken · Aug 17, 2020 at 09:15 AM

if it is only for simple things, just set up two layers, "left" and "right" then make the left camera only see the left layer, right camera only see right. Only works in multipass, not single pass

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.

Follow this Question

Answers Answers and Comments

91 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 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

Unity and 3D TV 1 Answer

Stereoscopic Images/Panoramas with Oculus OVRCameraRig 2 Answers

Virtual reality enabled doesn't show stereoscopic view on Android 1 Answer

Can a Stereoscopic video be played on an object ? not 360 or 180 via skybox 0 Answers

No shadows with splitscreen 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