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 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 graphics 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 - Everything 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. This 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 this. Both cameras are in the exact same location and share world position and rotation.

How do I fix this?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
3

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

I'm doing a similar thing 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 (which introduces problems I haven't been able to solve). Create a copy of your Camera (head) object, also childed to the [CameraRig] object. On this 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 anything is unclear and I'll elucidate.

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

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

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

SplitScreen shooter with Viewmodels and PlayerModels without so many layers? 1 Answer

Setting Vive ipd without using hmd knobs 1 Answer

Camera layering : UI shader is cleared by second camera with Depth Only flag 1 Answer

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

SteamVR: Eye camera does not seem to support depth only; 3D skybox implementation impossible 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