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 /
  • Help Room /
avatar image
3
Question by mgc90403 · Jul 18, 2016 at 03:41 AM · bugvreditorwindowframerate drops

VR.WaitForGPU lag UNLESS camera is selected in editor

I'm getting giant, regular spikes of "VR.WaitForGPU" - but ONLY when the active camera isn't selected in the hierarchy. If I simply select the camera, my FPS goes from 60-100 up to 200.

I'm running 5.4f1 with a Vive.

Comment
Add comment · Show 1
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 OmegaJak · Jul 28, 2016 at 07:31 PM 0
Share

I'm also seeing this on 5.4f1. The spikes are very regular, usually up to a time of 16-17 ms. I didn't notice any change from selecting the camera. In the GPU profiler the spikes are attributed to the "Other" category.

I also tried it in Unity 5.3.4f1, and saw similar spikes, though they were attributed to different causes. In the CPU profiler the spikes appears as "S$$anonymous$$mVR_Render.RenderLoop() [Coroutine: $$anonymous$$oveNext]" inside "PlayerEndOfFrame". In the GPU profiler the spikes are attributed to "RenderTexture.SetActive", with the spikes going up to ~20 GPU ms.

I have a GTX 1070 and an A$$anonymous$$D FX-8350. Hopefully this info helps someone figure it out.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by mgc90403 · Jul 18, 2016 at 03:42 AM

Side note - the issue persists upon building. Is there some way to tell Unity to act as if the camera is selected, at runtime?

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 MartijnIvory · Jul 27, 2016 at 02:34 PM

Getting the same thing... the spikes are about 16ms. I had not noticed that selecting the camera makes a difference, good catch:)

What could be going on here?

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 stack86 · Oct 03, 2016 at 03:31 AM

Yeah this is crazy, I get it too. I hadn't noticed the same lag building though, like mgc mentioned.

To make the issue less annoying (certainly not a fix) I whipped up a script to select the camera whenever you press play (just attach to your camera eye object)

 using UnityEngine;
 #if DEBUG
 using UnityEditor;
 #endif
 
 //attach this to the object you want to become selected when 'Play' is pressed in the editor
 //purpose: to fix the Unity/VR bug where framerate tanks if camera eye isn't selected
 public class SelectedOnPlay : MonoBehaviour {
 
     #if DEBUG
     SelectedOnPlay() {
         EditorApplication.playmodeStateChanged = HandleOnPlayModeChanged;
     }
 
     void HandleOnPlayModeChanged()
     {
         if (EditorApplication.isPlaying)
         {
             //select this object
             if(Selection.activeObject != gameObject)
                 Selection.activeObject = gameObject; 
         }
     }
     #endif
 }
 
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 AlanMattano · Apr 28, 2017 at 03:33 PM 0
Share

Using this script in the camera gives me 4% increment in fps performance.

avatar image Blosserdw · Jul 04, 2017 at 08:21 PM 1
Share

Really strange. Definitely see a huge FPS boost when the camera is selected, thanks for the temp fix at least. Running Unity 5.6.1f1 with S$$anonymous$$mVR plugin 1.2.2 for Vive

Edit: Although I notice that when the camera is selected now, the tracking on the controllers is really laggy :(

Edit 2: Actually, it seems that my lag/fps issues were solved by maximizing the game viewport on play (when playing in the editor). Idea suggested by a Valve dev here: https://s$$anonymous$$mcommunity.com/app/358720/discussions/0/357286532028854272/

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

78 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

Related Questions

[SteamVR] Object grabbed by left hand is rotated by 180, grabbed with right one is fine. 0 Answers

SteamVR Circular Drive reversing 1 Answer

Unity 5.3.1p3 - Viewports on Render Textures are warped when Virtual Reality Supported is enabled. 0 Answers

How do i fix my problem with minimizing/maximizing and just opening unity editor windows? 0 Answers

Cardboard VR - Right Eye is misaligned (Causing Double Vision),Unity Cardboard VR (Right Eye is misaligned) 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