Wednesday, 23 November 2016

Fading In and Out



In my game I wanted to fade the screen in and out to simulate the player closing and opening their eyes at the start and end of each sequence.

I decided to use a sprite texture attached to the canvas and effect its alpha channel. By changing its alpha channel between 1 and 0 I can effect the GUI transparency.




However I quickly realised that standard 2D GUI does not work in VR. This is because VR can not render certain effects including standard GUI.

 I found out however you can still use the canvas and 2D sprites for VR. In order to use the fading effect I wanted I had to effect the Canvas Group instead of the texture directly.





I also had to make sure that the canvas was up close to the player camera and also attached to it. This prevented any light or objects still being viable during the fading. 



No comments:

Post a Comment