Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity]: SteamVr HTC Vive weird FPS issue #280

Open
Vytek opened this issue Oct 4, 2016 · 3 comments
Open

[Unity]: SteamVr HTC Vive weird FPS issue #280

Vytek opened this issue Oct 4, 2016 · 3 comments
Assignees

Comments

@Vytek
Copy link

Vytek commented Oct 4, 2016

Many developer have problem with FPS using SteamVR Plugin for Unity (this problem is now only for HTC controller, etc..) Please see:

https://forum.unity3d.com/threads/steamvr-htc-vive-weird-fps-issue.426904/

@Vytek
Copy link
Author

Vytek commented Oct 18, 2016

Copied from: https://steamcommunity.com/app/358720/discussions/0/341537671986065508/

Removing all garbage generation from the SteamVR Unity SDK plugin

Hey everyone,

The Unity plugin missed a few spots where garbage was generated. I managed to fix all the issues and posted them over at the Unity forums. Hopefully the next version generate zero garbage while it does its thing.

Link to the discussion[forum.unity3d.com]

Takeaways include.

Disable "Update Dynamically" on all SteamVR_RenderModel scripts. This will disable button clicks and trigger moves.
SteamVR's use of params object[] args generates a new array and thus new garbage. Check the link for more info on the fix.
The render loop (which is generated every frame) creates a new WaitForEndOfFrame() object. Instead create a single class at the start and reference that. Check the link for all the details.

The Update Dynamically causes a lot of garbage because it uses a foreach loop on the enumerator. Couldn't figure out how to make that into a for loop. Foreach loops generate garbage in Unity's version of Mono.

Hope that the Unity devs at Valve can fix this for the next release! Took a while to track down these garbage issues but now I am happy to report I get zero generate garbage while running my scene. Weee!

@KellanHiggins
Copy link

Hey, original poster over at the Unity forums. Happy to answer any questions about my implementation to remove all the garbage. I think snippets of all the code are on the Unity answer forum page.

Happy to post again here if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants