Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 bruno-martelli · Oct 18, 2016 at 03:09 PM · camerasteamvirtualreality

Steam VR Fade camera

I know Steam VR has a fade script. Of course without being a programmer it's hard to get that to work. So I wondered if anyone had a working example they could show me?

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
10

Answer by dsentence · Mar 08, 2017 at 09:59 AM

I'm just going to leave this here, for if someone else is having trouble getting the steamvr fading to work.

What worked for me was to add the SteamVR_Fade script from the steamvr unity package to the camera child object under the [CameraRig] which has the SteamVR_Camera script on it. I believe in the standard prefab its the "Camera (eye)" object.

alt text

Then when I want to fade I just call the static SteamVR_Fade.Start method.

Test script I Used:

 using UnityEngine;
 
 public class SteamVrFadeTest : MonoBehaviour 
 {
     private float _fadeDuration = 2f;
 
     private void Start()
     {
         FadeToWhite();
         Invoke("FadeFromWhite", _fadeDuration);
     }

     private void FadeToWhite()
     {
         //set start color
         SteamVR_Fade.Start(Color.clear, 0f);
         //set and start fade to
         SteamVR_Fade.Start(Color.white, _fadeDuration);
     }

     private void FadeFromWhite()
     {
         //set start color
         SteamVR_Fade.Start(Color.white, 0f);
         //set and start fade to
         SteamVR_Fade.Start(Color.clear, _fadeDuration);
     }
 }

capture.png (68.9 kB)
Comment
Add comment · Show 5 · 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 livingtech · Jan 29, 2018 at 04:04 PM 0
Share

This worked great for me, thank you for posting it! $$anonymous$$uch obliged!

avatar image Patrk · Mar 11, 2019 at 11:25 PM 0
Share

Hi,
I have attached the steamVR fade script to the camera(eye) and then attached your script above to a random object, the script works ok but I just want it to fade from white and not the double fade, to and from, whats the correct syntax for this to work correctly?

avatar image dsentence Patrk · Mar 12, 2019 at 08:48 AM 0
Share

Just use the FadeFromWhite() method

 private void Start()
 {
     FadeFromWhite();
 }

avatar image Patrk dsentence · Mar 12, 2019 at 12:02 PM 0
Share

Hi many thanks for your reply, its working great now, it was just the invoke part that was throwing me.

Show more comments
avatar image
0

Answer by SweatyChair · Apr 14, 2021 at 09:51 AM

Addiction to @dsentence 's answer, if you want to fade out on scene change, you can simply use the SteamVR_LoadLevel:

 Valve.VR.SteamVR_LoadLevel.Begin(sceneName);


P.S. you can input the background color and fade out time.

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

100 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Windows Mixed Reality HMD Translation not tracked in Unity scene 1 Answer

why does my view change 0 Answers

GoogleVR (aka Cardboard): left and right cameras too separated in Android, but perfect in the Unity Game View! 1 Answer

SteamVR Fading to Blue? 0 Answers

taking an object out of my hand with the other 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