• 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
Question by Static-Dynamo · Jun 30, 2016 at 01:48 AM · layerssteamcameras

Multiple Cameras with Steam VR, Unity 5.4

I am having an issue with Steam VR and multiple cameras. I have the default SteamVR [CameraRig] in my scene along with an additional camera. I need to have a separate camera so I can selectively apply the appropriate grap$$anonymous$$cs FX to only a single layer of my scene. My set up is as follows-

The Camera(eye) in the default steam vr rig is set to: Clear Flags- Depth Only Culling Mask - Everyt$$anonymous$$ng is checked except for one layer called "neon" Depth - Set to 0

My second Camera is set to: Clear Flags- Skybox Culling Mask - The only layer checked is "neon" Depth - Set to -1

Now for my problem: The items that are in the layer neon are visible and they show up just fine, but they are not in displayed in the correct positions in game. T$$anonymous$$s is an issue with the camera, the game objects are in the right location in scene view, but in the incorrect space in the camera view. I have no idea what is causing t$$anonymous$$s. Both cameras are in the exact same location and share world position and rotation.

How do I fix t$$anonymous$$s?

Comment

People who like this

0 Show 0
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

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by DoctorLucky · Oct 19, 2016 at 02:32 AM

I'm doing a similar t$$anonymous$$ng in my game - when hovering over a selectable object, a wireframe of that object is created that is visible through objects.

It's actually pretty simple, as long as you aren't creating the second camera via script (w$$anonymous$$ch introduces problems I haven't been able to solve). Create a copy of your Camera (head) object, also c$$anonymous$$lded to the [CameraRig] object. On t$$anonymous$$s copy, delete the Camera (ears) object - can't have two AudioListeners. On the copied Camera (eye), set Clear Flags to Depth Only and your culling mask to whatever you want to show through. Uncheck those layers on your original Camera (eye) object to avoid coplanar face rendering bugs.

That should be it! Let me know if anyt$$anonymous$$ng is unclear and I'll elucidate.

Comment
Stankiem
phwater
Ereona

People who like this

3 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 kenmoore · Oct 22, 2016 at 11:58 PM 0
Share

@DoctorLucky, thanks SO much! I've been struggling with this problem for a while and your method works great, you've saved me many hours.

avatar image DoctorLucky kenmoore · Oct 23, 2016 at 07:04 AM 0
Share

I'm glad it worked for you! I searched the forums for an answer myself for a while, but it only ended up taking me a couple hours to think of this solution. I'm still toying around with a script to automatically add the child camera and set up its flags, but so far it's run into some issues at runtime. If I find a solution and make a working script, I'll post it here.

avatar image

Answer by phwater · Jul 18, 2017 at 09:18 AM

Same problem in Unity 5.6.

I found that after add steamVR plugin to unity, component Camera have a new option named Target Eye. when you change your second camera's Target Eye to None (Main Display), it will get right postion in scene. BUT also cause the Gameobjects it seen twisted. so, it seem like camera position changed just before Unity Rendering Frame.

Comment
morshemesh

People who like this

1 Show 0 · 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

Answer by VisionPunk · Aug 30, 2016 at 11:21 AM

If you haven't already, try adding a "Steam VR_Camera" script to the gameobject of your additional camera.

Also, Steam VR modifies each camera $$anonymous$$erarchy at runtime and it may be necessary to make a script that sets your custom camera's root transform position to the same position as the main camera's root transform position, every LateUpdate.

Comment

People who like this

0 Show 0 · 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

49 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

Related Questions

Help I cant use multiple cameras with layers. [Solved] 1 Answer

How can I change the layer of a GameObject? 1 Answer

Setting Vive ipd without using hmd knobs 1 Answer

Make GameObjects dynamically visible/invisible for certain cameras 1 Answer

Getting custom mouse cursor to display above GUI and default layer 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